Skip to content

Commit

Permalink
Merge pull request #108 from BenjamenMeyer/bugfix_basic-maintenance_2017
Browse files Browse the repository at this point in the history
Bugfix basic maintenance 2017
  • Loading branch information
BenjamenMeyer committed Dec 12, 2017
2 parents c94da13 + 2a26401 commit 57e155d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
*.py[cod]
__pycache__

# C extensions
*.so

# Packages
*.egg
*.egg-info
.eggs/
dist
build
eggs
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
install:
- pip install -r test-requirements.txt -r requirements.txt
- pip install .
Expand Down
1 change: 1 addition & 0 deletions eom/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def _tuple_to_cache_key(t):
key.update(key_data)
return key.hexdigest()


def _blacklist_cache_key(t):
"""Convert token to a cache key for blacklists"""
key_data = 'blacklist%(s_data)s' % {
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = eom
version = 0.9.0
version = 0.8.1
summary = Experimental OpenStack WSGI Middleware
description-file =
README.rst
Expand Down
1 change: 0 additions & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import hashlib
import logging
from wsgiref import simple_server
import unittest

import ddt
import fakeredis
Expand Down
3 changes: 2 additions & 1 deletion tests/test_bastion.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def test_restrict_close_match_route_hits_gate(self, route):
def test_empty_gate_headers_deny_access(self, route):
"""bastion should allow all traffic for this endpoint.
Based on the configuration for this test case."""
Based on the configuration for this test case.
"""
# override gate headers option
bastion._CONF.set_override(
'gate_headers',
Expand Down
34 changes: 17 additions & 17 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import mock
from stackinabox.stack import StackInABox
import stackinabox.util_requests_mock
import stackinabox.util.requests_mock

from eom import metrics
from tests import util
Expand Down Expand Up @@ -43,17 +43,17 @@ def test_get_conf(self):
self.assertIsNotNone(config)

def test_basic(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client

self.metrics = metrics.wrap(util.app)

def test_delete(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client
Expand All @@ -67,8 +67,8 @@ def test_delete(self):
self.metrics(my_env, self.start_response)

def test_get(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client
Expand All @@ -82,8 +82,8 @@ def test_get(self):
self.metrics(my_env, self.start_response)

def test_head(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client
Expand All @@ -97,8 +97,8 @@ def test_head(self):
self.metrics(my_env, self.start_response)

def test_patch(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client
Expand All @@ -112,8 +112,8 @@ def test_patch(self):
self.metrics(my_env, self.start_response)

def test_post(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client
Expand All @@ -127,8 +127,8 @@ def test_post(self):
self.metrics(my_env, self.start_response)

def test_put(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client
Expand All @@ -142,8 +142,8 @@ def test_put(self):
self.metrics(my_env, self.start_response)

def test_invalid_method(self):
with stackinabox.util_requests_mock.activate():
stackinabox.util_requests_mock.requests_mock_registration(
with stackinabox.util.requests_mock.activate():
stackinabox.util.requests_mock.requests_mock_registration(
'localhost')
with mock.patch('statsd.StatsClient') as mok_statsd_client:
mok_statsd_client.return_value = self.statsd_client
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[tox]
envlist = py26,py27,pypy,py33,py34,pep8
minversion=1.8
envlist = {py26,py27},pypy,{py33,py34,py35,py36},pep8
skip_missing_interpreters=True

[testenv]
setenv = VIRTUAL_ENV={envdir}
Expand Down Expand Up @@ -28,5 +30,4 @@ commands = {posargs}

[flake8]
builtins = _
exclude = build,env*,.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv

exclude = build,env*,.venv,.git,.tox,dist,doc,docs,*openstack/common*,*lib/python*,*.egg,.update-venv

0 comments on commit 57e155d

Please sign in to comment.