def test_check_status_OK(self): """ Check that we create an image object with a correct status. :return: """ temp = Image(identifier='an id', name='fake name', status=Image.OK, message='fake message') self.assertEqual(temp.status, Image.OK, 'The status is not the same')
def test_check_status_NOK(self): """ Check that we create an image object with a correct status. :return: """ try: Image(identifier='an id', name='fake name', status='fake status', message='fake message') except ValueError as error: self.assertEqual( error.args[0], 'Error, the status does not correspond to any of the defined values' ) self.assertEqual(error.args[1], 'fake status')