commit 22ec4c9226da797778f56d8d1303b61c4e3bf710 Author: Damian Johnson atagar@torproject.org Date: Tue Jul 17 09:29:32 2012 -0700
Dropping the ExitPolicy's test_parsing()
The test_parsing() test is redundant with the ExitPolicyRule tests, so dropping it. --- test/unit/exit_policy/policy.py | 35 ----------------------------------- 1 files changed, 0 insertions(+), 35 deletions(-)
diff --git a/test/unit/exit_policy/policy.py b/test/unit/exit_policy/policy.py index 8b74998..97cad1a 100644 --- a/test/unit/exit_policy/policy.py +++ b/test/unit/exit_policy/policy.py @@ -89,41 +89,6 @@ class TestExitPolicy(unittest.TestCase): self.assertEquals(expected_result, policy.is_exiting_allowed())
- def test_parsing(self): - """ - Tests parsing by the ExitPolicy class constructor. - """ - - exit_policies = stem.exit_policy.ExitPolicy("accept *:80", "accept *:443", "reject *:*") - self.assertEqual(str(exit_policies), "accept *:80, accept *:443, reject *:*") - - exit_policies = stem.exit_policy.ExitPolicy() - - # check ip address - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept 256.255.255.255:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept -10.255.255.255:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept 255.-10.255.255:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept 255.255.-10.255:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept -255.255.255.-10:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept a.b.c.d:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept 255.255.255:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept -255.255:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept 255:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept -:80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept :80") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept ...:80") - - # check input string - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "foo 255.255.255.255:80") - - # check ports - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept *:0001") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept *:-1") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept *:+1") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept *:+1-1") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept *:a") - self.assertRaises(ValueError, stem.exit_policy.ExitPolicy, "accept *:70000") - def test_microdesc_exit_parsing(self): microdesc_exit_policy = stem.exit_policy.MicrodescriptorExitPolicy("accept 80,443")