more allmydata.util test coverage, rename the test case to be more correct

This commit is contained in:
Brian Warner 2007-04-06 16:33:22 -07:00
parent 1a4cf6f7b7
commit d432099880

View File

@ -14,6 +14,7 @@ class IDLib(unittest.TestCase):
self.failUnlessEqual(idlib.b2a_or_none("\x12\x34"), "ci2a====") self.failUnlessEqual(idlib.b2a_or_none("\x12\x34"), "ci2a====")
def test_a2b(self): def test_a2b(self):
self.failUnlessEqual(idlib.a2b("ci2a===="), "\x12\x34") self.failUnlessEqual(idlib.a2b("ci2a===="), "\x12\x34")
self.failUnlessRaises(TypeError, idlib.a2b, "bogus")
def test_peerid(self): def test_peerid(self):
# these are 160-bit numbers # these are 160-bit numbers
peerid = "\x80" + "\x00" * 19 peerid = "\x80" + "\x00" * 19