Beispiel #1
0
 def download(self, destination: str = None):
     self._check_feature()
     for file_definition in self.fetch_files_list():
         driver: typing.Type[ArtifactDriver] = ArtifactDriversMap.match_type(
             file_definition.type
         )
         file_destination = pathlib.Path(destination or ".") / pathlib.Path(
             file_definition.file_path
         )
         file_destination.parent.mkdir(parents=True, exist_ok=True)
         driver.download_file(file_destination, file_definition)
Beispiel #2
0
 def test_match_by_type(self):
     self.assertEqual(ArtifactDriversMap.match_type("Local"), LocalArtifactDriver)
Beispiel #3
0
 def test_unmatched_type_raises_exception(self):
     with self.assertRaises(NeptuneUnhandledArtifactTypeException):
         ArtifactDriversMap.match_type("test2")
Beispiel #4
0
    def test_match_by_type(self):
        driver_instance = ArtifactDriversMap.match_type("test")

        self.assertEqual(driver_instance, self.test_driver_instance)
Beispiel #5
0
 def test_match_by_type(self):
     self.assertEqual(ArtifactDriversMap.match_type("S3"), S3ArtifactDriver)