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