commit 20175b52feab80003def73fc0829638cfeb84963 Author: Isis Lovecruft isis@torproject.org Date: Wed Apr 23 09:25:53 2014 +0000
Split a unittest for the Bridge class into several smaller tests. --- lib/bridgedb/test/test_Bridges.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/lib/bridgedb/test/test_Bridges.py b/lib/bridgedb/test/test_Bridges.py index b51019b..2c00618 100644 --- a/lib/bridgedb/test/test_Bridges.py +++ b/lib/bridgedb/test/test_Bridges.py @@ -61,21 +61,40 @@ class BridgeClassTest(unittest.TestCase): self.ip, self.orport, fingerprint=invalid_fingerprint)
- def test_Bridgehelperfunctions(self): + def test_getID(self): bridge = Bridges.Bridge(self.nickname, self.ip, self.orport, self.fingerprint) self.assertEqual(self.id_digest, bridge.getID())
+ def test_setDescriptorDigest(self): + """Test setting the server-descriptor digest value.""" + bridge = Bridges.Bridge(self.nickname, self.ip, self.orport, + self.fingerprint) testtext = 'thisisatest' bridge.setDescriptorDigest(testtext) self.assertEqual(bridge.desc_digest, testtext) + + def test_setExtraInfoDigest(self): + """Test setting the extra-info digest value.""" + bridge = Bridges.Bridge(self.nickname, self.ip, self.orport, + self.fingerprint) + testtext = 'thisisatest' bridge.setExtraInfoDigest(testtext) self.assertEqual(bridge.ei_digest, testtext) + + def test_setVerified(self): + """Test setting the `verified` attribute on a Bridge.""" + bridge = Bridges.Bridge(self.nickname, self.ip, self.orport, + self.fingerprint) bridge.setVerified() self.assertTrue(bridge.isVerified()) self.assertTrue(bridge.verified) self.assertEqual(self.id_digest, bridge.getID())
+ def test_setRunningStable(self): + """Test setting the `running` and `stable` attributes on a Bridge.""" + bridge = Bridges.Bridge(self.nickname, self.ip, self.orport, + self.fingerprint) self.assertFalse(bridge.running) self.assertFalse(bridge.stable) bridge.setStatus(True, True)
tor-commits@lists.torproject.org