def setup(self): self.default_conf = { 'nodes': {'wheezy': {'labels': ['amd64']}}, 'jenkins': { 'url': 'http://jenkins.example.com', 'user': '******', 'token': 'secret'}, } set_config(self.default_conf, overwrite=True)
def test_serversideerror_with_debug(self): expected_status_code = 500 expected_status = http_response_messages[expected_status_code] pecan.set_config({'wsme': {'debug': True}}) res = self.app.get('/divide_by_zero.json', expect_errors=True) self.assertEqual(res.status, expected_status) a = json.loads(res.body.decode('utf-8')) assert a['faultcode'] == 'Server' assert a['debuginfo'].startswith('Traceback (most recent call last):')
def tearDown(self): super(TestCase, self).tearDown() pecan.set_config({}, overwrite=True)
def tearDown(self): super(DCManagerApiTest, self).tearDown() pecan.set_config({}, overwrite=True)
def setUp(self): super(FunctionalTest, self).setUp() root = self.root config = {'app': {'root': root}} pecan.set_config(config, overwrite=True) self.app = webtest.TestApp(pecan.make_app(root))
def tearDown(self): super(BaseTestCase, self).tearDown() set_config({}, overwrite=True) self.removeLock()
def tearDown(self): super(FunctionalTest, self).tearDown() pecan.set_config({}, overwrite=True)
# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock import os import oslo_serialization.jsonutils as jsonutils import pecan PECAN_CONFIG_FILE = (os.getcwd() + "/gbpservice/nfp/pecan/api/config.py") pecan.set_config(PECAN_CONFIG_FILE, overwrite=True) import webtest import zlib from neutron.tests import base from pecan import rest from gbpservice.nfp.pecan import constants setattr(pecan, 'mode', constants.advanced) from gbpservice.contrib.nfp.configurator.advanced_controller import controller from gbpservice.nfp.pecan.api import root_controller reload(root_controller)
def setup(self): set_config( {'nodes': {'centos': {'labels': ['x86_64', 'centos', 'centos6']}}}, overwrite=True )
def setup(self): set_config( {'nodes': {'centos6': {'labels': ['x86_64', 'huge']}}}, overwrite=True ) self.msg = BecauseLabelIsOffline % 'amd64'
def tearDown(self): if os.environ.get('SURVEIL_FUNCTIONAL_MONGOMOCK', None) != 'True': self.mongoconnection.close() pecan.set_config({}, overwrite=True)
def tearDown(self): engine = connection.get_engine() set_config({}, overwrite=True) default_model.Base.metadata.drop_all(engine)
def tearDown(self): super(CinderVolumeFunctionalTest, self).tearDown() cfg.CONF.unregister_opts(app.common_opts) pecan.set_config({}, overwrite=True) core.ModelBase.metadata.drop_all(core.get_engine()) del fake_volumes[:]
def tearDown(self): super(QuotaControllerTest, self).tearDown() pecan.set_config({}, overwrite=True) cfg.CONF.unregister_opts(app.common_opts) core.ModelBase.metadata.drop_all(core.get_engine())
def tearDown(self): pecan.set_config({}, overwrite=True) super(PecanEndPointFunctionalTest, self).tearDown()
def tearDown(self): super(Nova_API_GW_FunctionalTest, self).tearDown() cfg.CONF.unregister_opts(app.common_opts) pecan.set_config({}, overwrite=True)
def tearDown(self): super(MicroVersionFunctionTest, self).tearDown() cfg.CONF.unregister_opts(app.common_opts) pecan.set_config({}, overwrite=True) core.ModelBase.metadata.drop_all(core.get_engine())
def test_string_is_wrong_does_not_match(self): self.default_conf['nodes'] = {} set_config(self.default_conf, overwrite=True) assert util.from_label('this is not garbage') is None
def test_string_is_right_but_does_not_match(self): msg = BecauseNodeIsBusy % 'wheezy' self.default_conf['nodes'] = {} set_config(self.default_conf, overwrite=True) assert util.from_label(msg) is None
def tearDown(self): super(TestIronicAPI, self).tearDown() pecan.set_config({}, overwrite=True)
def test_string_is_right_and_matches_node_from_name(self): msg = BecauseNodeIsBusy % 'wheezy' self.default_conf['nodes']['wheezy']['labels'] = [] set_config(self.default_conf, overwrite=True) assert util.from_label(msg) == 'wheezy'
def reset_pecan(): patcher.stop() pecan.set_config({}, overwrite=True)
def setup(self): set_config( {'nodes': {'centos6': {'labels': ['x86_64']}}}, overwrite=True ) self.msg = BecauseNodeIsOffline % 'rhel7'
def tearDown(self): super(API_FunctionalTest, self).tearDown() cfg.CONF.unregister_opts(app.common_opts) pecan.set_config({}, overwrite=True) core.ModelBase.metadata.drop_all(core.get_engine()) policy.reset()
def setup(self): set_config({"nodes": {"centos": {"labels": ["x86_64", "centos", "centos6"]}}}, overwrite=True)
def tearDown(self): super(BaseRESTTestCase, self).tearDown() set_config({}, overwrite=True)
def tearDown(self): """tear down method.""" super(FunctionalTest, self).tearDown() pecan.set_config({}, overwrite=True)
def _reset_pecan(self): pecan.set_config({}, overwrite=True)
def tearDown(self): super(BaseTest, self).tearDown() shutil.rmtree(self._tmpdir) set_config({}, overwrite=True)
def tearDown(self): set_config({}, overwrite=True)
def tearDown(self): self.mox.UnsetStubs() self.stubs.UnsetAll() self.stubs.SmartUnsetAll() self.mox.VerifyAll() set_config({}, overwrite=True)
def tearDown(self): pecan.set_config({}, overwrite=True) self.app.reset()
def tearDown(self): super(KBApiTest, self).tearDown() pecan.set_config({}, overwrite=True)
def reset_pecan(): pecan.set_config({}, overwrite=True)
def tearDown(self): set_config({}, overwrite=True) import deuce deuce.context = None
def tearDown(self): set_config({}, overwrite=True) shutil.rmtree(self._storagedir)
def tearDown(self): self._reset_db() set_config({}, overwrite=True)