Skip to content

Commit

Permalink
Add test when providing None
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Dec 12, 2024
1 parent 234c0df commit dd32f04
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ def test_available_repositories(tmpdir):
repositories.append(audb.Repository(repo, host, "file-system"))
# Fake dataset by adding db.yaml file
audeer.touch(audeer.mkdir(host, repo, f"name{n}", "1.0.0"), "db.yaml")
df = audb.available(repositories=repositories)
assert len(df) == 2
# Look at all repositories
for repositories_argument in [None, repositories]:
df = audb.available(repositories=repositories_argument)
assert len(df) == 2
for n, repository in enumerate(repositories):
# Test for string and list arguments
for repo_test in [repository, [repository]]:
df = audb.available(repositories=repo_test)
for repositories_argument in [repository, [repository]]:
df = audb.available(repositories=repositories_argument)
assert len(df) == 1
assert df.host.iloc[0] == repository.host
assert df.repository.iloc[0] == repository.name
Expand Down

0 comments on commit dd32f04

Please sign in to comment.