Skip to content

Commit

Permalink
#35 Fix unit tests and make them work with python 2 and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 6, 2017
1 parent 80a6530 commit afb42bd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions contrib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build/
tests/htmlcov
.coverage
coverage.xml
.cache
1 change: 0 additions & 1 deletion contrib/cortexutils/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def get_param(self, name, default=None, message=None):
:param default: Default value, if not found. Default: None
:param message: Error message. If given and name not found, exit with error. Default: None"""

print('get_param:' + str(name))
return self.__get_param(self.__input, name, default, message)

def summary(self, raw):
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 3 additions & 5 deletions contrib/tests/test.py → contrib/tests/suite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals

import os
import sys
Expand All @@ -13,16 +12,15 @@

def load_test_fixture(fixture_path):
path = os.path.dirname(os.path.abspath(__file__))
fixture_file = open(path + '/' + fixture_path, 'r', encoding="utf-8")
fixture_file = open(path + '/' + fixture_path)
input = fixture_file.read()
fixture_file.close()
sys.stdin = StringIO(input)


class TestMinimalConfig(unittest.TestCase):

def setUp(self):
load_test_fixture('test-minimal-config.json')
load_test_fixture('fixtures/test-minimal-config.json')
self.analyzer = Analyzer()

def test_default_config(self):
Expand All @@ -47,7 +45,7 @@ def test_params_data(self):
class TestProxyConfig(unittest.TestCase):

def setUp(self):
load_test_fixture('test-proxy-config.json')
load_test_fixture('fixtures/test-proxy-config.json')
self.analyzer = Analyzer()

def test_proxy_config(self):
Expand Down

0 comments on commit afb42bd

Please sign in to comment.