Skip to content

Commit 3629d25

Browse files
author
JAMES FUQIAN
committed
add support of LOCAL, TEST as target ENVs
1 parent fcaad64 commit 3629d25

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Required SDK configuration parameters include:
3535

3636
| Parameter | Value | Default |Description |
3737
| ------------- | ------------------------------- |----| --------------------------------------- |
38-
| `environment` | `SANDBOX` or `PRODUCTION` |`SANDBOX` | Blue Button 2.0 API environment |
38+
| `environment` | `SANDBOX` or `PRODUCTION` or `TEST` or `LOCAL`|`SANDBOX` | Blue Button 2.0 API environment |
3939
| `version` | `1` or `2` | `2` | Blue Button 2.0 version |
4040
| `client_id` | *`your_client_id`* | |OAuth2.0 client ID of your app |
4141
| `client_secret` | *`your_client_secret`* | |OAuth2.0 client secret of your app |
@@ -69,6 +69,8 @@ The Blue Button 2.0 API is available in V1 and V2 in a sandbox and production en
6969

7070
- Sandbox location: https://sandbox.bluebutton.cms.gov
7171
- Production location: https://api.bluebutton.cms.gov
72+
- Test location: https://test.bluebutton.cms.gov (for development testing with internal test server)
73+
- Local location: http://localhost:8000 (for development testing with a local BB2 server)
7274

7375
Version data formats:
7476

cms_bluebutton/cms_bluebutton.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ def set_configuration(self, config):
6969

7070
# Check environment setting
7171
env = config_dict.get("environment", None)
72-
if env in ["SANDBOX", "PRODUCTION"]:
72+
if env in ["LOCAL", "TEST", "SANDBOX", "PRODUCTION"]:
7373
self.base_url = ENVIRONMENT_URLS.get(env, None)
7474
else:
7575
raise ValueError(
7676
"Error: Configuration environment must be set to"
77-
" SANDBOX or PRODUCTION in: {}".format(config)
77+
"LOCAL or TEST or SANDBOX or PRODUCTION in: {}".format(config)
7878
)
7979

8080
# Check other settings are provided

cms_bluebutton/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
REFRESH_TOKEN_ENDPOINT = "/o/token/"
1010

1111
ENVIRONMENT_URLS = {
12+
"LOCAL": "http://localhost:8000",
13+
"TEST": "https://test.bluebutton.cms.gov",
1214
"SANDBOX": "https://sandbox.bluebutton.cms.gov",
1315
"PRODUCTION": "https://api.bluebutton.cms.gov",
1416
}

0 commit comments

Comments
 (0)