Skip to content

Commit

Permalink
added testing for dataset label
Browse files Browse the repository at this point in the history
  • Loading branch information
ntalluri committed Jul 15, 2024
1 parent f6f3563 commit c48b686
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,12 @@ def test_config_container_registry(self):
assert (config.config.container_prefix == config.DEFAULT_CONTAINER_PREFIX)

def test_dataset_label(self):
# TODO: test differnt invalid labels and combinationst that aren't allowed
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)

0 comments on commit c48b686

Please sign in to comment.