def testDefaultsToNull(self): string = str(rdf_objects.PathID()) self.assertEqual(string, "PathID('{}')".format("0" * 64))
def testFromBytesValidatesLength(self): with self.assertRaises(ValueError): rdf_objects.PathID(b"foobar")
def testFromRDFBytes(self): foo = rdf_objects.PathID(rdfvalue.RDFBytes(b"12345678" * 4)) self.assertEqual(foo, b"12345678" * 4)
def testFromBytesValidatesType(self): with self.assertRaises(TypeError): rdf_objects.PathID(42)
def testFromBytes(self): foo = rdf_objects.PathID(b"12345678" * 4) self.assertEqual(foo, b"12345678" * 4)