Example #1
0
 def test_test_odata_service_value_prop_not_tested(self):
     uri = '/redfish/v1/odata'
     resp.test_odata_service_value_prop(self.sut)
     result = get_result(self.sut, Assertion.RESP_ODATA_SERVICE_VALUE_PROP,
                         'GET', uri)
     self.assertIsNotNone(result)
     self.assertEqual(Result.NOT_TESTED, result['result'])
     self.assertIn('No response found for URI %s' % uri, result['msg'])
Example #2
0
 def test_test_odata_service_value_prop_pass(self):
     uri = '/redfish/v1/odata'
     add_response(self.sut,
                  uri,
                  'GET',
                  status_code=requests.codes.OK,
                  json={'value': []})
     resp.test_odata_service_value_prop(self.sut)
     result = get_result(self.sut, Assertion.RESP_ODATA_SERVICE_VALUE_PROP,
                         'GET', uri)
     self.assertIsNotNone(result)
     self.assertEqual(Result.PASS, result['result'])
Example #3
0
 def test_test_odata_service_value_prop_fail1(self):
     uri = '/redfish/v1/odata'
     add_response(self.sut,
                  uri,
                  'GET',
                  status_code=requests.codes.NOT_FOUND)
     resp.test_odata_service_value_prop(self.sut)
     result = get_result(self.sut, Assertion.RESP_ODATA_SERVICE_VALUE_PROP,
                         'GET', uri)
     self.assertIsNotNone(result)
     self.assertEqual(Result.FAIL, result['result'])
     self.assertIn(
         '%s request to URI %s failed with status %s' %
         ('GET', uri, requests.codes.NOT_FOUND), result['msg'])
Example #4
0
 def test_test_odata_service_value_prop_fail3(self):
     uri = '/redfish/v1/odata'
     add_response(self.sut,
                  uri,
                  'GET',
                  status_code=requests.codes.OK,
                  json={'value': {}})
     resp.test_odata_service_value_prop(self.sut)
     result = get_result(self.sut, Assertion.RESP_ODATA_SERVICE_VALUE_PROP,
                         'GET', uri)
     self.assertIsNotNone(result)
     self.assertEqual(Result.FAIL, result['result'])
     self.assertIn(
         'The value property for the OData service '
         'document is type %s; expected list' % 'dict', result['msg'])