Fix MediaType() call and add tests for / and /v1
This commit is contained in:
parent
1cc511ca11
commit
078b67dfa5
@ -96,7 +96,9 @@ class V1(base.APIBase):
|
|||||||
'',
|
'',
|
||||||
bookmark=True)
|
bookmark=True)
|
||||||
]
|
]
|
||||||
v1.media_types = [MediaType('application/json')]
|
v1.media_types = [MediaType('application/json',
|
||||||
|
('application/vnd.openstack.'
|
||||||
|
'ironic-python-agent.v1+json'))]
|
||||||
return v1
|
return v1
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +44,20 @@ class TestTeethAPI(unittest.TestCase):
|
|||||||
client = test.Client(api, wrappers.BaseResponse)
|
client = test.Client(api, wrappers.BaseResponse)
|
||||||
return client.open(self._get_env_builder(method, path, data, query))
|
return client.open(self._get_env_builder(method, path, data, query))
|
||||||
|
|
||||||
|
def test_root(self):
|
||||||
|
mock_agent = mock.MagicMock()
|
||||||
|
api_server = app.setup_app(mock_agent)
|
||||||
|
|
||||||
|
response = self._make_request(api_server, 'GET', '/')
|
||||||
|
self.assertEqual(response.status, '200 OK')
|
||||||
|
|
||||||
|
def test_v1_root(self):
|
||||||
|
mock_agent = mock.MagicMock()
|
||||||
|
api_server = app.setup_app(mock_agent)
|
||||||
|
|
||||||
|
response = self._make_request(api_server, 'GET', '/v1')
|
||||||
|
self.assertEqual(response.status, '200 OK')
|
||||||
|
|
||||||
def test_get_agent_status(self):
|
def test_get_agent_status(self):
|
||||||
status = agent.TeethAgentStatus('TEST_MODE', time.time(), 'v72ac9')
|
status = agent.TeethAgentStatus('TEST_MODE', time.time(), 'v72ac9')
|
||||||
mock_agent = mock.MagicMock()
|
mock_agent = mock.MagicMock()
|
||||||
|
Loading…
Reference in New Issue
Block a user