@@ -24,21 +24,12 @@ def test_run_init_metadata():
2424 run = Run (mode = 'offline' )
2525
2626 with pytest .raises (RuntimeError ) as exc_info :
27-
2827 run .init (metadata = {'dataset.x1_lower' : x1_lower , 'dataset.x1_upper' : x1_upper },
2928 description = "A test to validate inputs passed into metadata dictionary"
3029 )
3130
3231 assert exc_info .match (r"value is not a valid integer" )
3332
34- with pytest .raises (RuntimeError ) as exc_info :
35-
36- run .init (metadata = {'dataset.x1_lower' : x1_lower , 'dataset.x1_upper' : x1_upper }, tags = 1 ,
37- description = "A test to validate inputs passed into folder"
38- )
39-
40- assert exc_info .match (r"value is not a valid integer" )
41-
4233def test_run_init_tags ():
4334 """
4435 Check that run.init throws an exception if tags are not a list
@@ -52,10 +43,28 @@ def test_run_init_tags():
5243 run = Run (mode = 'offline' )
5344
5445 with pytest .raises (RuntimeError ) as exc_info :
55-
5646 run .init (metadata = {'dataset.x1_lower' : x1_lower , 'dataset.x1_upper' : x1_upper }, tags = 1 ,
5747 description = "A test to validate tag inputs passed into run.init"
5848 )
5949
6050 assert exc_info .match (r"value is not a valid list" )
6151
52+ def test_run_init_folder ():
53+ """
54+ Check that run.init throws an exception if folder input is not specified correctly
55+ """
56+ os .environ ["SIMVUE_TOKEN" ] = "test"
57+ os .environ ["SIMVUE_URL" ] = "https://simvue.io"
58+
59+ x1_lower = 2
60+ x1_upper = 6
61+
62+ run = Run (mode = 'offline' )
63+
64+ with pytest .raises (RuntimeError ) as exc_info :
65+ run .init (metadata = {'dataset.x1_lower' : x1_lower , 'dataset.x1_upper' : x1_upper }, tags = [1 ,2 ,3 ], folder = 'test_folder' ,
66+ description = "A test to validate folder input passed into run.init"
67+ )
68+
69+ assert exc_info .match (r"string does not match regex" )
70+
0 commit comments