def testSerializeIncorrectType(self): with self.assertRaisesRegexp(ValueError, "type"): rdf_objects.ToCategorizedPath("MEMORY", ["foo", "bar"])
def testSerializeOsRoot(self): path_type = rdf_objects.PathInfo.PathType.OS path = rdf_objects.ToCategorizedPath(path_type, []) self.assertEqual(path, "fs/os")
def testSerializeTemp(self): path_type = rdf_objects.PathInfo.PathType.TEMP path = rdf_objects.ToCategorizedPath(path_type, ["blargh"]) self.assertEqual(path, "temp/blargh")
def testSerializeRegistry(self): path_type = rdf_objects.PathInfo.PathType.REGISTRY path = rdf_objects.ToCategorizedPath(path_type, ["thud", "baz"]) self.assertEqual(path, "registry/thud/baz")
def testSerializeTsk(self): path_type = rdf_objects.PathInfo.PathType.TSK path = rdf_objects.ToCategorizedPath(path_type, ["quux", "norf"]) self.assertEqual(path, "fs/tsk/quux/norf")
def testSerializeOs(self): path_type = rdf_objects.PathInfo.PathType.OS path = rdf_objects.ToCategorizedPath(path_type, ["foo", "bar"]) self.assertEqual(path, "fs/os/foo/bar")