Skip to content

Commit

Permalink
Fix unit tests broken by requests-mock
Browse files Browse the repository at this point in the history
Now requests-mock records request url in log[1], so it is
invalid to check that the logger output does NOT contain
request url.

Also, fix url passed to request mock as now it requires
complete url is passed

[1] jamielennox/requests-mock#93

Change-Id: I4bab30a6705b7cab6b5a569dd61c442263e39995
  • Loading branch information
kajinamit committed Sep 6, 2019
1 parent f7e75f4 commit 27d4376
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions keystoneclient/tests/unit/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,6 @@ def test_logger_object_passed(self):
self.assertIn(list(response.keys())[0], output)
self.assertIn(list(response.values())[0], output)

self.assertNotIn(self.TEST_URL, self.logger.output)
self.assertNotIn(list(response.keys())[0], self.logger.output)
self.assertNotIn(list(response.values())[0], self.logger.output)

Expand Down Expand Up @@ -1026,7 +1025,6 @@ def test_logger_object_passed(self):
self.assertIn(list(response.keys())[0], output)
self.assertIn(list(response.values())[0], output)

self.assertNotIn(self.TEST_URL, self.logger.output)
self.assertNotIn(list(response.keys())[0], self.logger.output)
self.assertNotIn(list(response.values())[0], self.logger.output)

Expand Down
2 changes: 1 addition & 1 deletion keystoneclient/tests/unit/v3/test_role_assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_include_names_assignments_list(self):
ref_list = self.TEST_ALL_RESPONSE_LIST
self.stub_entity('GET',
[self.collection_key,
'?include_names'],
'?include_names=True'],
entity=ref_list)

returned_list = self.manager.list(include_names=True)
Expand Down

0 comments on commit 27d4376

Please sign in to comment.