Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 def test_unserialize_empty(self):
     unserialized = unserialize(b"")
     self.assertEqual(None, unserialized)