PYTHONPATH=$(COMMON_PYTHON_PATH):$(abs_top_builddir)/src/bin/xfrout:$(abs_top_builddir)/src/bin/xfrin:$(abs_top_builddir)/src/lib/dns/python/.libs \
$(LIBRARY_PATH_PLACEHOLDER) \
B10_FROM_BUILD=$(abs_top_builddir) \
+ TESTDATASRCDIR=$(abs_top_srcdir)/src/lib/python/isc/statistics/tests/testdata \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
import unittest
import threading
from datetime import timedelta
+import os
import isc.config
TEST_ZONE_NAME_STR = "example.com."
+TESTDATA_SRCDIR = os.getenv("TESTDATASRCDIR")
from isc.statistics import counter
event.set()
for th in threads: th.join()
-class TestCounter(unittest.TestCase):
+class TestBasicMethods(unittest.TestCase):
+ TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec1.spec'
+
def setUp(self):
- self.counter = counter.Counter()
+ self.counter = counter.init(self.TEST_SPECFILE_LOCATION)
self._statistics_data = {}
self._start_time = {}
self._counter_name = "counter"
'socket/%s/tcp/%s' % counter_name, 2)
self.check_dump_statistics()
+class TestCounter1(BaseTestCounter, unittest.TestCase):
+ TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec1.spec'
+
+class TestCounter2(BaseTestCounter, unittest.TestCase):
+ TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec2.spec'
+
+class TestCounter3(BaseTestCounter, unittest.TestCase):
+ TEST_SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec3.spec'
+
if __name__== "__main__":
unittest.main()