Skip to content

Commit

Permalink
Merge pull request #15 from BenjamenMeyer/refactor_tests
Browse files Browse the repository at this point in the history
Refactor tests
  • Loading branch information
BenjamenMeyer committed Mar 5, 2015
2 parents 0695cd1 + 486fda5 commit 1fe617f
Show file tree
Hide file tree
Showing 14 changed files with 321 additions and 277 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError

[run]
omit = *tests*
9 changes: 9 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[nosetests]
match=^test
where=stackinabox
with-coverage=true
cover-package=stackinabox
cover-erase=1
cover-inclusive=true
cover-branches=true
cover-min-percentage=70
6 changes: 4 additions & 2 deletions stackinabox/services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import re
import uuid

import six


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -64,7 +66,7 @@ def base_url(self, value):
self.__base_url,
value))
self.__base_url = value
for k, v in self.routes.items():
for k, v in six.iteritems(self.routes):
v['regex'] = StackInABoxService.__get_service_regex(value,
v['uri'])

Expand All @@ -88,7 +90,7 @@ def request(self, method, request, uri, headers):
'query = "{3}"'
.format(self.__id, self.name, uri_path, uri_qs))

for k, v in self.routes.items():
for k, v in six.iteritems(self.routes):
logger.debug('StackInABoxService ({0}:{1}): Checking if '
'route {2} handles...'
.format(self.__id, self.name, v['uri']))
Expand Down
9 changes: 5 additions & 4 deletions stackinabox/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""
import logging
import re
import threading
import uuid

import threading
import six


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -90,7 +91,7 @@ def base_url(self, value):
logger.debug('StackInABox({0}): Updating URL from {1} to {2}'
.format(self.__id, self.__base_url, value))
self.__base_url = value
for k, v in self.services.items():
for k, v in six.iteritems(self.services):
matcher, service = v
service.base_url = StackInABox.__get_service_url(value,
service.name)
Expand All @@ -100,7 +101,7 @@ def base_url(self, value):
def reset(self):
logger.debug('StackInABox({0}): Resetting...'
.format(self.__id))
for k, v in self.services.items():
for k, v in six.iteritems(self.services):
matcher, service = v
logger.debug('StackInABox({0}): Resetting Service {1}'
.format(self.__id, service.name))
Expand Down Expand Up @@ -133,7 +134,7 @@ def call(self, method, request, uri, headers):
logger.debug('StackInABox({0}): Received call to {1} - {2}'
.format(self.__id, method, uri))
service_uri = StackInABox.__get_services_url(uri, self.base_url)
for k, v in self.services.items():
for k, v in six.iteritems(self.services):
matcher, service = v
logger.debug('StackInABox({0}): Checking if Service {1} handles...'
.format(self.__id, service.name))
Expand Down
183 changes: 0 additions & 183 deletions stackinabox/test/test_advanced.py

This file was deleted.

85 changes: 0 additions & 85 deletions stackinabox/test/test_basic.py

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 1fe617f

Please sign in to comment.