コード例 #1
0
ファイル: validator_api.py プロジェクト: Fiware/ops.Validator
def main():
    """Launch validator API """
    try:
        config.parse_args()
        logging.setup(CONF, 'validator_api')
        app = config.load_paste_app("validator_api")
        port, host = (CONF.bind_port, CONF.bind_host)
        LOG.info(_LI('Starting Validator ReST API on %(host)s:%(port)s'),
                 {'host': host, 'port': port})
        server = wsgi.Service(app, port, host)
        server.start()
        server.wait()
    except RuntimeError as e:
        msg = six.text_type(e)
        sys.exit("ERROR: %s" % msg)
コード例 #2
0
ファイル: base.py プロジェクト: Fiware/ops.Validator
#       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 mox

from oslo_config import cfg
from validator.common import log
import testtools
import fixtures

CONF = cfg.CONF
log.setup(CONF, 'validator')


class ValidatorTestCase(testtools.TestCase):
    """Default test environment setter"""

    def setUp(self):
        """setup logger fixture"""
        super(ValidatorTestCase, self).setUp()
        # self.useFixture(fixtures.FakeLogger())
        self.useFixture(fixtures.WarningsCapture())
        self.m = mox.Mox()
        self.addCleanup(self.m.UnsetStubs)

    def override_config(self, name, override, group=None):
        """