Update usage of gabbi in Cloudkitty test

Update usage of gabbi in CK tests, also set upper constraints for CK.

Change-Id: Idb207161d2704200e8e6108d3f3049ce95e9f797
This commit is contained in:
Jeremy Liu 2017-01-09 15:54:32 +08:00 committed by Luka Peschke
parent 5baa3b8fe3
commit 8fea4e1ec7
3 changed files with 6 additions and 5 deletions

View File

@ -17,10 +17,10 @@
#
import os
from gabbi import handlers
from gabbi.handlers import base
class EnvironStoreHandler(handlers.ResponseHandler):
class EnvironStoreHandler(base.ResponseHandler):
"""Hackish response handler used to store data in environment.
Store data into an environment variable to implement some kind of variable
@ -30,5 +30,6 @@ class EnvironStoreHandler(handlers.ResponseHandler):
test_key_value = {}
def action(self, test, key, value=None):
data = test.extract_json_path_value(test.json_data, value)
data = test.content_handlers[0].extract_json_path_value(
test.response_data, value)
os.environ[key] = test.replace_template(data)

View File

@ -8,7 +8,7 @@ hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0
coverage>=3.6 # Apache-2.0
kombu<4.0.0 # BSD
ddt>=1.0.1 # MIT
gabbi>=1.11.0,<=1.25.0 # Apache-2.0
gabbi>=1.26.1 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testrepository>=0.0.18 # Apache-2.0/BSD
mock>=1.2 # BSD

View File

@ -7,7 +7,7 @@ envlist = py35,py27,pep8
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
install_command = pip install {opts} {packages}
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt