def test_unserialize_invalid_isbn(self): unserialized = unserialize(b"default/123456789") self.assertEqual(None, unserialized) unserialized = unserialize(b"default/123456789012") self.assertEqual(None, unserialized) unserialized = unserialize(b"default/123456789012a") self.assertEqual(None, unserialized)
def test_unserialize_invalid_voice(self): unserialized = unserialize(b"1234567890123") self.assertEqual(None, unserialized) unserialized = unserialize(b"./1234567890123") self.assertEqual(None, unserialized) unserialized = unserialize(b"/1234567890123") self.assertEqual(None, unserialized) unserialized = unserialize(b"//1234567890123") self.assertEqual(None, unserialized)
def test_unserialize_valid(self): unserialized = unserialize(b"default/1234567890123") self.assertEqual(("default", "1234567890123"), unserialized) unserialized = unserialize(b"default/1234567890") self.assertEqual(("default", "1234567890"), unserialized)
def test_unserialize_empty(self): unserialized = unserialize(b"") self.assertEqual(None, unserialized)