@@ -27,6 +27,22 @@ def test_read_config_json_equals_yaml():
2727
2828
2929def test_valid_config ():
30+ # valid config local env
31+ bb = BlueButton (config = CONFIGS_DIR + "json/bluebutton-sample-config-valid-local.json" )
32+ assert bb .base_url == "http://localhost:8000"
33+ assert bb .client_id == "<your BB2 client_id here>"
34+ assert bb .client_secret == "<your BB2 client_secret here>"
35+ assert bb .callback_url == "https://fake-local/your/callback/here"
36+ assert bb .version == 1
37+
38+ # valid config test env
39+ bb = BlueButton (config = CONFIGS_DIR + "json/bluebutton-sample-config-valid-test.json" )
40+ assert bb .base_url == "https://test.bluebutton.cms.gov"
41+ assert bb .client_id == "<your BB2 client_id here>"
42+ assert bb .client_secret == "<your BB2 client_secret here>"
43+ assert bb .callback_url == "https://www.fake-test.com/your/callback/here"
44+ assert bb .version == 1
45+
3046 # valid config sbx
3147 bb = BlueButton (config = CONFIGS_DIR + "json/bluebutton-sample-config-valid-sbx.json" )
3248 assert bb .base_url == "https://sandbox.bluebutton.cms.gov"
@@ -53,6 +69,7 @@ def test_valid_config():
5369 "callback_url" : "https://www.fake-prod.com/your/callback/here" ,
5470 "version" : 1 ,
5571 }
72+
5673 bb = BlueButton (config_dict )
5774 assert bb .base_url == "https://api.bluebutton.cms.gov"
5875 assert bb .client_id == "<your BB2 client_id here>"
@@ -95,7 +112,7 @@ def test_config_setting_environment():
95112 with pytest .raises (
96113 ValueError ,
97114 match = r"Error: Configuration environment must"
98- " be set to SANDBOX or PRODUCTION in:.*" ,
115+ " be set to LOCAL or TEST or SANDBOX or PRODUCTION in:.*" ,
99116 ):
100117 BlueButton (config = CONFIGS_DIR + file_name )
101118
0 commit comments