Buckets:

download
raw
930 Bytes
from pathlib import Path
import pytest
from nos.common.git import cached_repo
def test_common_cached_repo():
repo_url = "https://github.com/google/styleguide.git"
tag = "gh-pages"
subdir = cached_repo(repo_url, force=True)
assert subdir is not None
assert Path(subdir).exists()
subdir = cached_repo(repo_url, subdirectory="go/", tag=tag, force=True)
assert subdir is not None
assert Path(subdir).exists()
subdir = cached_repo(
f"https://github.com/google/styleguide/archive/refs/heads/{tag}.zip",
repo_name="styleguide",
subdirectory="go/",
force=True,
)
assert subdir is not None
assert Path(subdir).exists()
with pytest.raises(ValueError):
subdir = cached_repo(repo_url.replace(".git", ""), subdirectory="go/", tag="fake-tag")
with pytest.raises(ValueError):
subdir = cached_repo(repo_url, branch="2.x", tag="2.x")

Xet Storage Details

Size:
930 Bytes
·
Xet hash:
b48582bcd86fbde7d18048684b1e33972c82c850f4b42f393d6984813a68de9d

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.