Fixing push status that has been broken since moving to a client (#80)

* Fixing push status that has been broken since moving to a client

* Adding unit test to cover the bug
This commit is contained in:
mtakaki
2020-01-28 01:42:49 -08:00
committed by GitHub
parent 79a9a7f8d6
commit df2d094dc6
6 changed files with 99 additions and 66 deletions

View File

@@ -145,3 +145,11 @@ class ClientTest(unittest.TestCase):
self.assertEqual(status, ComponentStatus.OPERATIONAL,
'Getting component status value is incorrect.')
@requests_mock.mock()
def test_push_status(self, m):
m.put(f'{CACHET_URL}/components/123?id=123&status={ComponentStatus.PARTIAL_OUTAGE.value}',
headers={'X-Cachet-Token': TOKEN})
response = self.client.push_status(123, ComponentStatus.PARTIAL_OUTAGE)
self.assertTrue(response.ok, 'Pushing status value is failed.')