示例#1
0
 def test_serialize_invalid_isbn(self):
     serialized = serialize("default", "123456789")
     self.assertEqual(b"", serialized)
     serialized = serialize("default", "123456789012")
     self.assertEqual(b"", serialized)
     serialized = serialize("default", "123456789012a")
     self.assertEqual(b"", serialized)
示例#2
0
 def test_serialize_invalid_voice(self):
     serialized = serialize("/", "1234567890123")
     self.assertEqual(b"", serialized)
     serialized = serialize(".", "1234567890123")
     self.assertEqual(b"", serialized)
     serialized = serialize("", "1234567890123")
     self.assertEqual(b"", serialized)
示例#3
0
 def test_serialize_empty(self):
     serialized = serialize("", "")
     self.assertEqual(b"", serialized)
     serialized = serialize("", "1234567890123")
     self.assertEqual(b"", serialized)
示例#4
0
 def test_serialize_valid(self):
     serialized = serialize("default", "1234567890123")
     self.assertEqual(b"default/1234567890123", serialized)
     serialized = serialize("nabaztag", "1234567890")
     self.assertEqual(b"nabaztag/1234567890", serialized)