Last active
January 19, 2016 21:28
-
-
Save missaugustina/59d378bfe465690eed39 to your computer and use it in GitHub Desktop.
api_samples_test_base error on instantiation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CODE SNIPPET: | |
import mock | |
from nova import test | |
from nova.tests.functional import api_samples_test_base | |
class TestCompareResult(test.NoDBTestCase): | |
"""Provide test coverage for result comparison logic in functional tests""" | |
def getApiSampleTestBaseHelper(self): | |
return api_samples_test_base.ApiSampleTestBase('setUp') | |
def setUp(self): | |
super(TestCompareResult, self).setUp() | |
self.ast = self.getApiSampleTestBaseHelper() | |
self.ast.api_major_version = 'v2' | |
self.ast.compute = mock.MagicMock() | |
def test_bare_strings_match(self): | |
"""compare 2 bare strings that match""" | |
sample_data = u'foo' | |
response_data = u'foo' | |
result = self.ast._compare_result(subs=self.ast._get_regexes(), | |
expected=sample_data, | |
result=response_data, | |
result_str="Test") | |
CONSOLE: | |
Traceback (most recent call last): | |
File "/home/auggy/dev/openstack/nova/nova/tests/unit/api_samples_test_base/test_compare_result.py", line 44, in test_bare_strings_match | |
result = self.ast._compare_result(subs=self.ast._get_regexes(), | |
File "/home/auggy/dev/openstack/nova/nova/tests/functional/api_samples_test_base.py", line 355, in _get_regexes | |
'api_vers': self.api_major_version, | |
AttributeError: 'ApiSampleTestBase' object has no attribute 'api_major_version' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment