Skip to content

Commit ea9c0a5

Browse files
committed
Fix Category API location
1 parent fe663e5 commit ea9c0a5

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

opus/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def fields(self):
133133

134134
def category(self, name='obs_general'):
135135
'''Get all fields in a category'''
136-
return Category(self.load('category/'+name))
136+
return Category(self.load('categories/'+name))
137137

138138
def categories(self):
139139
'''List category names'''

tests/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,15 @@ def test_api_fields(api):
314314

315315
@responses.activate
316316
def test_api_category(api):
317-
category = open('tests/api/category/obs_general.json', 'r').read()
317+
category = open('tests/api/categories/obs_general.json', 'r').read()
318318
responses.add(responses.GET,
319-
'http://localhost/category/obs_general.json',
319+
'http://localhost/categories/obs_general.json',
320320
body=category)
321321

322322
resp = api.category('obs_general')
323323

324324
assert len(responses.calls) == 1
325-
assert responses.calls[0].request.url == 'http://localhost/category/obs_general.json'
325+
assert responses.calls[0].request.url == 'http://localhost/categories/obs_general.json'
326326
assert responses.calls[0].response.text == category
327327

328328
assert resp.name == 'obs_general'

tests/test_categories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
@pytest.fixture
88
def category():
9-
json = JSON.loads(open('tests/api/category/obs_general.json', 'r').read())
9+
json = JSON.loads(open('tests/api/categories/obs_general.json', 'r').read())
1010
return Category(json)
1111

1212
@pytest.fixture

0 commit comments

Comments
 (0)