Skip to content

Commit 399d602

Browse files
author
Neil Grey
committed
Cleaning up tests so travis-ci can automate them all
1 parent e5449df commit 399d602

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ python:
44
- "2.7"
55
# command to install dependencies
66
install:
7-
- pip install nose --use-mirrors
7+
- pip install nose
88
before_script:
99
- cp ./tests/example_config ./tests/config
1010
# command to run tests
11-
script: nosetests tests.tests_unit tests.test_client
11+
script: nosetests -w tests/
1212
notifications:
1313
email:
1414
- api@shotgunsoftware.com

shotgun_api3/shotgun.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def __init__(self,
409409
else:
410410
self.__ca_certs = os.environ.get('SHOTGUN_API_CACERTS')
411411

412-
self.base_url = (base_url or "").lower()
412+
self.base_url = (base_url or "")
413413
self.config.scheme, self.config.server, api_base, _, _ = \
414414
urlparse.urlsplit(self.base_url)
415415
if self.config.scheme not in ("http", "https"):

tests/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Base class for Shotgun API tests."""
2+
import os
23
import re
34
import unittest
45
from ConfigParser import ConfigParser
@@ -300,13 +301,13 @@ def __init__(self):
300301
self.shot_code = None
301302
self.task_content = None
302303

303-
304304
def read_config(self, config_path):
305305
config_parser = ConfigParser()
306306
config_parser.read(config_path)
307307
for section in config_parser.sections():
308308
for option in config_parser.options(section):
309-
value = config_parser.get(section, option)
309+
value = (os.environ.get('SG_{0}'.format(str(option).upper())) or
310+
config_parser.get(section, option))
310311
setattr(self, option, value)
311312

312313

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def test_rpc_error(self):
240240

241241
try:
242242
self.sg.info()
243-
except api.Fault, e:
243+
except api.Fault as e:
244244
self.assertEqual("Go BANG", str(e))
245245

246246
def test_call_rpc(self):

0 commit comments

Comments
 (0)