class PathConverterTest(UnitTestBase): def setUp(self): super(PathConverterTest, self).setUp() builder = ArtifactPathBuilder("test") self.converter = PathConverter(builder) def test_from_cloud_metadata(self): path = "andy_gertjejansen/_metadata_test.txt.yaml" expected = "/test/artifact/andy_gertjejansen/test.txt" self.assertEqual(expected, self.converter.from_cloud_metadata(path))
def resource_identity_factory(self): """ Returns: pyshelf.resource_identity_factory.ResourceIdentityFactory """ if not self._resource_identity_factory: builder = ArtifactPathBuilder(self.config["referenceName"]) path_converter = PathConverter(builder) self._resource_identity_factory = ResourceIdentityFactory( path_converter) return self._resource_identity_factory
def setUp(self): super(PathConverterTest, self).setUp() builder = ArtifactPathBuilder("test") self.converter = PathConverter(builder)
def path_converter(self): if not self._path_converter: self._path_converter = PathConverter(self.artifact_path_builder) return self._path_converter