Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
[pep8]: reformatted some dicts the tests/test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tasdikrahman committed Apr 5, 2017
1 parent ef8150a commit 7c9bc2d
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
except Exception as e:
import mock


class TestModule(unittest.TestCase):
"""Checks for the sanity of all module methods"""

Expand Down Expand Up @@ -56,8 +57,8 @@ def test_meaning_not_found(self, mock_api_call):
@mock.patch('vocabulary.vocabulary.requests.get')
def test_meaning_key_error(self, mock_api_call):
res = {
"result" : "ok",
"phrase" : "humming"
"result": "ok",
"phrase": "humming"
}

mock_api_call.return_value = mock.Mock()
Expand Down Expand Up @@ -111,8 +112,8 @@ def test_synonynm_not_found(self, mock_api_call):
@mock.patch('vocabulary.vocabulary.requests.get')
def test_synonynm_tuc_key_error(self, mock_api_call):
res = {
"result" : "ok",
"phrase" : "angry"
"result": "ok",
"phrase": "angry"
}

mock_api_call.return_value = mock.Mock()
Expand All @@ -124,9 +125,9 @@ def test_synonynm_tuc_key_error(self, mock_api_call):
@mock.patch('vocabulary.vocabulary.requests.get')
def test_synonynm_empty_list(self, mock_api_call):
res = {
"result" : "ok",
"tuc" : [],
"phrase" : "angry"
"result": "ok",
"tuc": [],
"phrase": "angry"
}

mock_api_call.return_value = mock.Mock()
Expand Down Expand Up @@ -177,8 +178,8 @@ def test_translate_not_found(self, mock_api_call):
@mock.patch('vocabulary.vocabulary.requests.get')
def test_translate_tuc_key_error(self, mock_api_call):
res = {
"result" : "ok",
"phrase" : "english"
"result": "ok",
"phrase": "english"
}

mock_api_call.return_value = mock.Mock()
Expand All @@ -190,9 +191,9 @@ def test_translate_tuc_key_error(self, mock_api_call):
@mock.patch('vocabulary.vocabulary.requests.get')
def test_translate_empty_list(self, mock_api_call):
res = {
"result" : "ok",
"tuc" : [],
"phrase" : "english"
"result": "ok",
"tuc": [],
"phrase": "english"
}

mock_api_call.return_value = mock.Mock()
Expand Down Expand Up @@ -306,7 +307,6 @@ def test_usageExample_not_found(self, mock_api_call):

self.assertFalse(vb.usage_example("hillock"))


@mock.patch('vocabulary.vocabulary.requests.get')
def test_usageExample_empty_list(self, mock_api_call):
res = {
Expand Down Expand Up @@ -414,7 +414,7 @@ def test_respond_as_dict_2(self):

def test_respond_as_dict_3(self):
data = json.loads('{"text": ["hummus"]}')
expected_result = {"text" : "hummus"}
expected_result = {"text": "hummus"}
result = rp().respond(data, 'dict')
if sys.version_info[:2] <= (2, 7):
self.assertItemsEqual(expected_result, result)
Expand Down Expand Up @@ -448,5 +448,6 @@ def test_respond_as_list_3(self):
else:
self.assertCountEqual(expected_result, result)


if __name__ == "__main__":
unittest.main()

0 comments on commit 7c9bc2d

Please sign in to comment.