Esempio n. 1
0
 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)
Esempio n. 2
0
File: test_ws.py Progetto: Kjir/wsme
 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):')
Esempio n. 3
0
 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))
Esempio n. 6
0
 def tearDown(self):
     super(BaseTestCase, self).tearDown()
     set_config({}, overwrite=True)
     self.removeLock()
Esempio n. 7
0
 def tearDown(self):
     super(FunctionalTest, self).tearDown()
     pecan.set_config({}, overwrite=True)
Esempio n. 8
0
#
#         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)
Esempio n. 9
0
 def setup(self):
     set_config(
         {'nodes': {'centos': {'labels': ['x86_64', 'centos', 'centos6']}}},
         overwrite=True
     )
Esempio n. 10
0
 def setup(self):
     set_config(
         {'nodes': {'centos6': {'labels': ['x86_64', 'huge']}}},
         overwrite=True
     )
     self.msg = BecauseLabelIsOffline % 'amd64'
Esempio n. 11
0
 def tearDown(self):
     if os.environ.get('SURVEIL_FUNCTIONAL_MONGOMOCK', None) != 'True':
         self.mongoconnection.close()
     pecan.set_config({}, overwrite=True)
Esempio n. 12
0
 def tearDown(self):
     engine = connection.get_engine()
     set_config({}, overwrite=True)
     default_model.Base.metadata.drop_all(engine)
Esempio n. 13
0
 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[:]
Esempio n. 14
0
 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()
Esempio n. 16
0
 def tearDown(self):
     super(Nova_API_GW_FunctionalTest, self).tearDown()
     cfg.CONF.unregister_opts(app.common_opts)
     pecan.set_config({}, overwrite=True)
Esempio n. 17
0
 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())
Esempio n. 18
0
 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
Esempio n. 19
0
 def tearDown(self):
     super(TestCase, self).tearDown()
     pecan.set_config({}, overwrite=True)
Esempio n. 20
0
 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
Esempio n. 21
0
 def tearDown(self):
     super(TestIronicAPI, self).tearDown()
     pecan.set_config({}, overwrite=True)
Esempio n. 22
0
 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'
Esempio n. 23
0
 def reset_pecan():
     patcher.stop()
     pecan.set_config({}, overwrite=True)
Esempio n. 24
0
 def setup(self):
     set_config(
         {'nodes': {'centos6': {'labels': ['x86_64']}}},
         overwrite=True
     )
     self.msg = BecauseNodeIsOffline % 'rhel7'
Esempio n. 25
0
 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())
Esempio n. 26
0
 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()
Esempio n. 27
0
 def setup(self):
     set_config({"nodes": {"centos": {"labels": ["x86_64", "centos", "centos6"]}}}, overwrite=True)
Esempio n. 28
0
 def tearDown(self):
     super(BaseRESTTestCase, self).tearDown()
     set_config({}, overwrite=True)
Esempio n. 29
0
 def tearDown(self):
     """tear down method."""
     super(FunctionalTest, self).tearDown()
     pecan.set_config({}, overwrite=True)
Esempio n. 30
0
 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[:]
Esempio n. 31
0
 def tearDown(self):
     super(BaseRESTTestCase, self).tearDown()
     set_config({}, overwrite=True)
Esempio n. 32
0
 def _reset_pecan(self):
     pecan.set_config({}, overwrite=True)
Esempio n. 33
0
 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))
Esempio n. 34
0
 def tearDown(self):
     super(BaseTest, self).tearDown()
     shutil.rmtree(self._tmpdir)
     set_config({}, overwrite=True)
Esempio n. 35
0
 def tearDown(self):
     set_config({}, overwrite=True)
Esempio n. 36
0
 def tearDown(self):
     self.mox.UnsetStubs()
     self.stubs.UnsetAll()
     self.stubs.SmartUnsetAll()
     self.mox.VerifyAll()
     set_config({}, overwrite=True)
Esempio n. 37
0
 def _reset_pecan(self):
     pecan.set_config({}, overwrite=True)
Esempio n. 38
0
 def tearDown(self):
     pecan.set_config({}, overwrite=True)
     self.app.reset()
Esempio n. 39
0
 def tearDown(self):
     if os.environ.get('SURVEIL_FUNCTIONAL_MONGOMOCK', None) != 'True':
         self.mongoconnection.close()
     pecan.set_config({}, overwrite=True)
Esempio n. 40
0
 def tearDown(self):
     super(KBApiTest, self).tearDown()
     pecan.set_config({}, overwrite=True)
Esempio n. 41
0
 def reset_pecan():
     pecan.set_config({}, overwrite=True)
Esempio n. 42
0
 def tearDown(self):
     super(TestIronicAPI, self).tearDown()
     pecan.set_config({}, overwrite=True)
Esempio n. 43
0
 def tearDown(self):
     pecan.set_config({}, overwrite=True)
     self.app.reset()
Esempio n. 44
0
 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
Esempio n. 45
0
    def tearDown(self):
        set_config({}, overwrite=True)

        import deuce
        deuce.context = None
Esempio n. 46
0
 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
Esempio n. 47
0
 def tearDown(self):
     set_config({}, overwrite=True)
Esempio n. 48
0
 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 tearDown(self):
     pecan.set_config({}, overwrite=True)
     super(PecanEndPointFunctionalTest, self).tearDown()
Esempio n. 50
0
 def reset_pecan():
     patcher.stop()
     pecan.set_config({}, overwrite=True)
Esempio n. 51
0
 def reset_pecan():
     pecan.set_config({}, overwrite=True)
Esempio n. 52
0
 def tearDown(self):
     set_config({}, overwrite=True)
     shutil.rmtree(self._storagedir)
 def tearDown(self):
     super(FunctionalTest, self).tearDown()
     pecan.set_config({}, overwrite=True)
 def tearDown(self):
     self._reset_db()
     set_config({}, overwrite=True)