Skip to content

Commit d76670f

Browse files
SFr-2478: Setting github api url as a constant (#515)
1 parent b85d0bf commit d76670f

File tree

6 files changed

+2
-7
lines changed

6 files changed

+2
-7
lines changed

config/example.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ NYPL_API_CLIENT_TOKEN_URL: xxx
5454

5555
# GITHUB API Credentials
5656
GITHUB_API_KEY: xxx
57-
GITHUB_API_ROOT: https://api.github.com/graphql
5857

5958
# Bardo CCE API URL
6059
BARDO_CCE_API: xxx

config/production.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ DRB_API_PORT: '80'
6565

6666
# GITHUB API Credentials
6767
# GITHUB_API_KEY must be configured in secrets file
68-
GITHUB_API_ROOT: https://api.github.com/graphql
6968

7069
# Bardo CCE API URL
7170
BARDO_CCE_API: http://sfr-c-ecsal-14v3injrieoy5-258691445.us-east-1.elb.amazonaws.com/search/

config/qa.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ DRB_API_PORT: '80'
6565

6666
# GITHUB API Credentials
6767
# GITHUB_API_KEY must be configured in secrets file
68-
GITHUB_API_ROOT: https://api.github.com/graphql
6968

7069
# Bardo CCE API URL
7170
BARDO_CCE_API: http://sfr-c-ecsal-14v3injrieoy5-258691445.us-east-1.elb.amazonaws.com/search/

managers/gutenberg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, repoOrder, repoSortField, startTime, pageSize):
1717
self.startTime = startTime or None
1818
self.pageSize = pageSize or 100
1919
self.githubAPIKey = os.environ['GITHUB_API_KEY']
20-
self.githubAPIRoot = os.environ['GITHUB_API_ROOT']
20+
self.githubAPIRoot = 'https://api.github.com/graphql'
2121

2222
self.cursor = None
2323
self.repos = []

tests/helper.py

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class TestHelpers:
4242
'NYPL_API_CLIENT_SECRET': 'test_api_secret',
4343
'NYPL_API_CLIENT_TOKEN_URL': 'test_api_token_url',
4444
'GITHUB_API_KEY': 'test_github_key',
45-
'GITHUB_API_ROOT': 'test_github_url',
4645
'BARDO_CCE_API': 'test_cce_url',
4746
'MUSE_MARC_URL': 'test_muse_url',
4847
'MUSE_CSV_URL': 'test_muse_csv',

tests/unit/test_gutenberg_manager.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def test_initializer(self, testInstance):
5858
assert testInstance.startTime is None
5959
assert testInstance.pageSize == 100
6060
assert testInstance.githubAPIKey == 'test_github_key'
61-
assert testInstance.githubAPIRoot == 'test_github_url'
6261
assert testInstance.cursor is None
6362
assert testInstance.repos == []
6463
assert testInstance.dataFiles == []
@@ -209,7 +208,7 @@ def test_queryGraphQL_success(self, testInstance, mocker):
209208

210209
assert testResponse == 'testResponse'
211210
mockPost.assert_called_once_with(
212-
'test_github_url',
211+
testInstance.githubAPIRoot,
213212
json={'query': 'testQuery'},
214213
headers={'Authorization': 'bearer test_github_key'}
215214
)

0 commit comments

Comments
 (0)