def test_parse_failure(self): with self.assertRaises(NotParseable): ObjectId.parse(b'?', Params())
def test_parse(self): ret, buf = ObjectId.parse(b' one_2-three four', Params()) self.assertIsInstance(ret, ObjectId) self.assertEqual(b'one_2-three', ret.value) self.assertEqual(b' four', buf)