Skip to content

Commit

Permalink
updated testing to test error and correct dataset labels
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Jul 15, 2024
1 parent c48b686 commit f26f1f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,19 @@ def test_config_container_registry(self):
config.init_global(test_config)
assert (config.config.container_prefix == config.DEFAULT_CONTAINER_PREFIX)

def test_dataset_label(self):
def test_error_dataset_label(self):
test_config = get_test_config()

error_test_dicts = [{"label":"test$"}, {"label":"@test'"}, {"label":"[test]"}, {"label":"test-test"}, {"label":"✉"}, {"label":"test/test-2____te+st&te'st*868_"}]

for test_dict in error_test_dicts:
test_config["datasets"]= [test_dict]
with pytest.raises(ValueError): #raises error if any chars other than letters, numbers, or underscores are in dataset label
config.init_global(test_config)

def test_correct_dataset_label(self):
test_config = get_test_config()
correct_test_dicts = [{"label":"test"}, {"label":"123"}, {"label":"test123"}, {"label":"123test"}, {"label":"test123test"}, {"label":"_"}, {"label":"test_test"}, {"label":"_test"}, {"label":"test_"}]

for test_dict in correct_test_dicts:
test_config["datasets"]= [test_dict]
config.init_global(test_config)

0 comments on commit f26f1f5

Please sign in to comment.