示例#1
0
 def test_match_by_path(self):
     self.assertEqual(
         ArtifactDriversMap.match_path("file:///path/to/"), LocalArtifactDriver
     )
     self.assertEqual(
         ArtifactDriversMap.match_path("/path/to/"), LocalArtifactDriver
     )
示例#2
0
def _extract_file_list(
        path: List[str],
        entries: List[Tuple[str, Optional[str]]]) -> List[ArtifactFileData]:
    files: List[ArtifactFileData] = list()

    for entry_path, entry_destination in entries:
        driver: Type[ArtifactDriver] = ArtifactDriversMap.match_path(
            entry_path)
        artifact_files = driver.get_tracked_files(
            path=entry_path, destination=entry_destination)

        if len(artifact_files) == 0:
            raise NeptuneEmptyLocationException(location=entry_path,
                                                namespace="/".join(path))

        files.extend(artifact_files)

    return files
示例#3
0
    def test_match_by_path(self):
        driver_instance = ArtifactDriversMap.match_path("test://path/to/file")

        self.assertEqual(driver_instance, self.test_driver_instance)
示例#4
0
 def test_unmatched_path_raises_exception(self):
     with self.assertRaises(NeptuneUnhandledArtifactSchemeException):
         ArtifactDriversMap.match_path("test2://path/to/file")
示例#5
0
 def test_match_by_path(self):
     self.assertEqual(
         ArtifactDriversMap.match_path(f"s3://{self.bucket_name}/path/to/"),
         S3ArtifactDriver,
     )