Skip to content

Commit

Permalink
Merge pull request #48 from RaccoonResearch/antbaez/fixing_issues
Browse files Browse the repository at this point in the history
fixed test for upload_directory function
  • Loading branch information
antbaez9 authored Jun 25, 2024
2 parents 50fe10a + 1d7e2cf commit 94e13f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions distributaur/tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,16 @@ def test_upload_directory():
repo_path = distributaur.get_env("HF_REPO_PATH", "data")

# Upload the directory to the repository
distributaur.upload_directory(temp_dir, repo_path)
distributaur.upload_directory(temp_dir)

# Check if the files exist in the Hugging Face repository
api = HfApi(token=hf_token)
repo_files = api.list_repo_files(
repo_id=repo_id, repo_type="dataset", token=hf_token
)
for file in test_files:
assert os.path.join(repo_path, file) in repo_files
print(file)
assert file in repo_files

for file in test_files:
os.remove(os.path.join(temp_dir, file))
Expand Down

0 comments on commit 94e13f1

Please sign in to comment.