diff options
author | Casey Deccio <casey@deccio.net> | 2019-01-11 06:10:57 +0300 |
---|---|---|
committer | Casey Deccio <casey@deccio.net> | 2019-01-11 06:10:57 +0300 |
commit | ab0ccd179dac17a58f8d4ca41a8cb7926b1ed7fb (patch) | |
tree | 4c435d956f5beea1b20976cf64ae5459fab816ff /tests | |
parent | e4a6cce232bd99dcc04b510b3675971ee7cc8f02 (diff) |
Split tests into offline and online
Diffstat (limited to 'tests')
-rw-r--r-- | tests/offline_tests.py (renamed from tests/script_tests.py) | 19 | ||||
-rw-r--r-- | tests/online_tests.py | 25 |
2 files changed, 25 insertions, 19 deletions
diff --git a/tests/script_tests.py b/tests/offline_tests.py index af13e6e..74bed2e 100644 --- a/tests/script_tests.py +++ b/tests/offline_tests.py @@ -4,25 +4,6 @@ import os import subprocess import unittest -class DNSProbeTestCase(unittest.TestCase): - def setUp(self): - self.devnull = io.open('/dev/null', 'wb') - - def tearDown(self): - self.devnull.close() - - def test_authoritative_probe_root(self): - self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', '-A', '.'], stdout=self.devnull), 0) - - def test_authoritative_probe_example_com(self): - self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', '-A', 'example.com'], stdout=self.devnull), 0) - - def test_recursive_probe_root(self): - self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', '.'], stdout=self.devnull), 0) - - def test_recursive_probe_example_com(self): - self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', 'example.com'], stdout=self.devnull), 0) - class DNSGrokTestCase(unittest.TestCase): def setUp(self): self.devnull = io.open('/dev/null', 'wb') diff --git a/tests/online_tests.py b/tests/online_tests.py new file mode 100644 index 0000000..95eca10 --- /dev/null +++ b/tests/online_tests.py @@ -0,0 +1,25 @@ +import io +import subprocess +import unittest + +class DNSProbeTestCase(unittest.TestCase): + def setUp(self): + self.devnull = io.open('/dev/null', 'wb') + + def tearDown(self): + self.devnull.close() + + def test_authoritative_probe_root(self): + self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', '-A', '.'], stdout=self.devnull), 0) + + def test_authoritative_probe_example_com(self): + self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', '-A', 'example.com'], stdout=self.devnull), 0) + + def test_recursive_probe_root(self): + self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', '.'], stdout=self.devnull), 0) + + def test_recursive_probe_example_com(self): + self.assertEqual(subprocess.call(['dnsviz', 'probe', '-d', '0', 'example.com'], stdout=self.devnull), 0) + +if __name__ == '__main__': + unittest.main() |