Skip to content

Commit

Permalink
Address (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbridbur committed Apr 22, 2022
1 parent 33a3778 commit c87d463
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# -*- coding: utf-8 -*-
"""Test helpers"""

from .matchers import Matcher
6 changes: 6 additions & 0 deletions tests/helpers/matchers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Matcher:
def __init__(self, condition):
self.condition = condition

def __eq__(self, other):
return self.condition(other)
5 changes: 3 additions & 2 deletions tests/test_generic_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
from src.rev_ai.generic_api_client import GenericApiClient
from src.rev_ai import __version__
from tests.helpers import Matcher

try:
from urllib.parse import urljoin
Expand Down Expand Up @@ -218,7 +219,7 @@ def test_get_result_json_with_kwargs_with_success(self, mock_session, make_mock_
assert res == data
mock_session.request.assert_called_once_with(
"GET",
url,
Matcher(lambda x: '?name1=1&name2=2' in x or '?name2=2&name1=1' in x),
headers=client.default_headers)

def test_get_result_object_with_success(self, mock_session, make_mock_response):
Expand Down Expand Up @@ -271,7 +272,7 @@ def test_get_result_object_with_kwargs_with_success(self, mock_session, make_moc
assert res == data
mock_session.request.assert_called_once_with(
"GET",
url,
Matcher(lambda x: '?name1=1&name2=2' in x or '?name2=2&name1=1' in x),
headers=client.default_headers)


Expand Down

0 comments on commit c87d463

Please sign in to comment.