Skip to content

Commit

Permalink
Fix support for Python 3.4 (#2)
Browse files Browse the repository at this point in the history
Fix support for 3.4

* Fix relative import for Python 3

* Make Travis CI run Tox tests

* Run coverage tests with tox in py26 and py34
  • Loading branch information
bloomonkey authored and Cody Lee committed Apr 24, 2017
1 parent 8720e43 commit 58537cf
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 41 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
language: python
python:
- '2.7'
install: pip install -r requirements.pip
script: bash ./run_coverage.sh
- '3.4'
install:
- pip install -r requirements.pip
- pip install tox-travis
script: tox
deploy:
provider: pypi
on:
Expand All @@ -15,4 +18,3 @@ deploy:
secure: JhLffSYa/ES20jPiXmmEwEq6jLwpd2VEDe3KT+iqZ6LPygxCFjyoT8rI7LBz91PsjjBZa1jVFw7kAdtT6RvLOFHp3Pol87ULpmM8PBD++FIShxPFds2p+5UzEvQ/D3+6E9gxeHIwNQk6RGwYm4hF7kGaWQwhtD+Y3mXhL4pjvtGy+3rkXWHhe0LNvRdCUqogsv7EXBhRZunb/KqLW7rtn7NlTnBVz+Sf97GPuNtgmMG2UPnCcsip0V+hUgMcpMXqlVbPpFNfq2k901qKfRMgg4hjum6ML+oKCqiXFzH/cTCj9okNzK56yAkSN3lrfUPKHIVAfLAYDXexFCTDpbr970XnTtpFBlqzBnB8W4dYXrBb00j3vWy3yJrXZSQSwn8ETUBC4ObSKFJseIA0OFMlUoBHkVyLo0iH30VGGAlI0p3FXY+DBSQxIvyCIlbHbmHEcPlKyb6K5sEZgAT6mqPiPi0d6MnDNXF4R5+LAI0uZhr0EzXZkKoP0wH1DUoR72NJIyfGPKEvmY/os86UcvI9fGKCaqC15I2gMoKBWJ2s7xjiDvZ5Hi1vhK/kP2rQnGDrUd2wclhufMARiW0KYhJsfgMj4Q5ICQ4bMP3SWuXRc9A6toMLnH82z0r2sPLv8OFidbPW9wq4tnfZ0+WtJ2p+FARauEStHeVXdpfwkZds25I=
after_success:
- coveralls

6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[tox]
envlist = py27, py34
envlist = py{27,34}

[testenv]
whitelist_externals =
rm
deps =
nose
coverage
Expand All @@ -12,5 +14,5 @@ deps =

commands =
{envpython} setup.py -q install
nosetests -vv --attr=unit
nosetests -vv --attr=unit --with-coverage --cover-erase --cover-package=wiremock --cover-html --cover-xml --cover-min-percentage=85 --cover-html-dir={toxinidir}/coverage/ --cover-xml-file={toxinidir}/coverage/coverage.xml
rm -Rf build || true
4 changes: 2 additions & 2 deletions wiremock/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from base_entity import *
from base_resource import BaseResource, RestClient
from .base_entity import *
from .base_resource import BaseResource, RestClient
21 changes: 10 additions & 11 deletions wiremock/client.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@

# import Exceptions
from exceptions import *
from .exceptions import *

# import Models
from resources.settings import GlobalSetting
from resources.mappings import Mapping, MappingResponse, MappingRequest, DelayDistribution,\
from .resources.settings import GlobalSetting
from .resources.mappings import Mapping, MappingResponse, MappingRequest, DelayDistribution,\
ResponseFaultType, DelayDistributionMethods, BasicAuthCredentials, WireMockMatchers, HttpMethods, \
CommonHeaders, MappingMeta, AllMappings
from resources.requests import RequestResponse, RequestResponseDefinition, RequestResponseRequest, \
from .resources.requests import RequestResponse, RequestResponseDefinition, RequestResponseRequest, \
RequestCountResponse, RequestResponseAll, RequestResponseFindResponse, RequestResponseAllMeta
from resources.near_misses import NearMissMatchResponse, NearMissMatchRequest, NearMissMatchResult, \
from .resources.near_misses import NearMissMatchResponse, NearMissMatchRequest, NearMissMatchResult, \
NearMissRequestPatternResult, NearMissMatch, NearMissMatchPatternRequest

# import Resources
from resources.settings.resource import GlobalSettings
from resources.mappings.resource import Mappings
from resources.requests.resource import Requests
from resources.near_misses.resource import NearMisses
from resources.scenarios.resource import Scenarios
from .resources.settings.resource import GlobalSettings
from .resources.mappings.resource import Mappings
from .resources.requests.resource import Requests
from .resources.near_misses.resource import NearMisses
from .resources.scenarios.resource import Scenarios
20 changes: 10 additions & 10 deletions wiremock/exceptions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from api_exception import ApiException
from api_unavailable_exception import ApiUnavailableException
from client_exception import ClientException
from forbidden_exception import ForbiddenException
from invalid_input_exception import InvalidInputException
from not_found_exception import NotFoundException
from requires_login_exception import RequiresLoginException
from server_exception import ServerException
from timeout_exception import TimeoutException
from unexpected_response_exception import UnexpectedResponseException
from .api_exception import ApiException
from .api_unavailable_exception import ApiUnavailableException
from .client_exception import ClientException
from .forbidden_exception import ForbiddenException
from .invalid_input_exception import InvalidInputException
from .not_found_exception import NotFoundException
from .requires_login_exception import RequiresLoginException
from .server_exception import ServerException
from .timeout_exception import TimeoutException
from .unexpected_response_exception import UnexpectedResponseException
2 changes: 1 addition & 1 deletion wiremock/exceptions/api_unavailable_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class ApiUnavailableException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/client_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class ClientException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/forbidden_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class ForbiddenException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/invalid_input_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class InvalidInputException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/not_found_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class NotFoundException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/requires_login_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class RequiresLoginException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/server_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class ServerException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/timeout_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class TimeoutException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/exceptions/unexpected_response_exception.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api_exception import ApiException
from .api_exception import ApiException


class UnexpectedResponseException(ApiException):
Expand Down
2 changes: 1 addition & 1 deletion wiremock/resources/mappings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from models import Mapping, MappingResponse, MappingRequest, DelayDistribution, ResponseFaultType, \
from .models import Mapping, MappingResponse, MappingRequest, DelayDistribution, ResponseFaultType, \
DelayDistributionMethods, BasicAuthCredentials, WireMockMatchers, HttpMethods, CommonHeaders, \
MappingMeta, AllMappings
2 changes: 1 addition & 1 deletion wiremock/resources/near_misses/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from models import NearMissMatchResponse, NearMissMatchRequest, NearMissMatchResult, NearMissRequestPatternResult, \
from .models import NearMissMatchResponse, NearMissMatchRequest, NearMissMatchResult, NearMissRequestPatternResult, \
NearMissMatch, NearMissMatchPatternRequest
2 changes: 1 addition & 1 deletion wiremock/resources/requests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from models import RequestResponse, RequestResponseDefinition, RequestResponseRequest, RequestCountResponse, \
from .models import RequestResponse, RequestResponseDefinition, RequestResponseRequest, RequestCountResponse, \
RequestResponseAll, RequestResponseFindResponse, RequestResponseAllMeta
2 changes: 1 addition & 1 deletion wiremock/resources/settings/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from models import GlobalSetting
from .models import GlobalSetting

0 comments on commit 58537cf

Please sign in to comment.