Beispiel #1
0
def test_asset_spec_get_local_versions():
    spec = AssetSpec(name="name", versioning="major_minor")
    assert spec.get_local_versions("not_a_dir") == []
    asset_dir = [
        "testdata", "test-bucket", "assets-prefix", "category", "asset"
    ]
    local_path = os.path.join(tests.TEST_DIR, *asset_dir)
    assert spec.get_local_versions(local_path) == ["1.0", "0.1", "0.0"]
Beispiel #2
0
def test_asset_spec_get_local_versions():
    spec = AssetSpec(name="name", versioning="simple_date")
    assert spec.get_local_versions("not_a_dir") == []
    asset_dir = [
        "testdata",
        "test-bucket",
        "assets-prefix",
        "category",
        "simple_date_asset",
    ]
    local_path = os.path.join(tests.TEST_DIR, *asset_dir)
    assert spec.get_local_versions(local_path) == [
        "2021-11-15T17-31-06Z",
        "2021-11-14T18-00-00Z",
    ]
Beispiel #3
0
 def _list_local_versions(self, spec: AssetSpec) -> List[str]:
     local_name = os.path.join(self.assets_dir, *spec.name.split("/"))
     return spec.get_local_versions(local_name)