Skip to content

Commit

Permalink
Update test bucket move to my personal account
Browse files Browse the repository at this point in the history
1. Update anonymous bucket name
2. Add timezone offset for info from OSS
  • Loading branch information
karajan1001 committed Apr 5, 2023
1 parent 25537c5 commit f828b34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def put_file(endpoint, bucket_name, key, filename):


@pytest.fixture(scope="session")
def file_in_anonymous(endpoint, test_directory):
bucket = "dvc-anonymous"
def file_in_anonymous(endpoint, test_directory, test_bucket_name):
bucket = f"{test_bucket_name}-anonymous"
file = f"{test_directory}/file"
put_object(endpoint, bucket, file, "foobar")
return f"/{bucket}/{file}"
Expand Down
4 changes: 3 additions & 1 deletion tests/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def test_info(ossfs, test_path):
ossfs.touch(test_info_b)
info = ossfs.info(test_info_a)
linfo = ossfs.ls(test_info_a, detail=True)[0]
assert abs(info.pop("LastModified") - linfo.pop("LastModified")) <= 1
offset = time.timezone if (time.localtime().tm_isdst == 0) else time.altzone

assert abs(info.pop("LastModified") - linfo.pop("LastModified") + offset) <= 1
assert info == linfo

# test not exist dir
Expand Down

0 comments on commit f828b34

Please sign in to comment.