Skip to content

Commit

Permalink
Remove uneeded test deps, fix some little issues
Browse files Browse the repository at this point in the history
Change-Id: I85d25a766eb2c8130038f1ca2775fff8c458d2fb
  • Loading branch information
Maxime Vidori committed Apr 28, 2016
1 parent 0ec2e3c commit 8bb129d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
9 changes: 4 additions & 5 deletions dci/common/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,15 @@ def schema_factory(schema):
# #
###############################################################################

split = lambda string: string.split(',')

split_coerce = v.Coerce(lambda s: s.split(','))
args = Schema({
v.Optional('limit', default=None): v.All(v.Coerce(int), v.Range(0),
msg=INVALID_LIMIT),
v.Optional('offset', default=None): v.All(v.Coerce(int), v.Range(0),
msg=INVALID_OFFSET),
v.Optional('sort', default=[]): v.Coerce(split),
v.Optional('where', default=[]): v.Coerce(split),
v.Optional('embed', default=[]): v.Coerce(split)
v.Optional('sort', default=[]): split_coerce,
v.Optional('where', default=[]): split_coerce,
v.Optional('embed', default=[]): split_coerce
}, extra=v.REMOVE_EXTRA)

###############################################################################
Expand Down
4 changes: 0 additions & 4 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
flake8==2.4.1
pep8==1.5.7
mccabe==0.2.1
hacking>=0.10.1
pytest>=2.6.2
pytest-cov>=1.8.0
pytest-xdist
6 changes: 4 additions & 2 deletions tests/common/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,10 @@ def generate_invalids_and_errors():

invalids = dict([utils.INVALID_NAME, utils.INVALID_JOB_STATE] +
invalids)
errors = dict([utils.INVALID_NAME_ERROR, utils.INVALID_JOB_STATE_ERROR]
+ errors)
errors = dict(
[utils.INVALID_NAME_ERROR, utils.INVALID_JOB_STATE_ERROR] +
errors
)
return invalids, errors

def test_post_extra_data(self):
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ whitelist_externals =
commands =
sh ./scripts/start_db.sh
sh ./scripts/start_es.sh
py.test -v {posargs: --cov-report html --cov dci/server tests}
py.test -v {posargs: --cov-report html --cov dci tests}

[testenv:pep8]
commands =
flake8

[flake8]
ignore = H405,H304,H104
ignore = H405,H304,H104,E402
exclude=.venv,.git,.tox,dist,*egg,*.egg-info,build,examples,doc
show-source = True

0 comments on commit 8bb129d

Please sign in to comment.