Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug flake8 #59

Merged
merged 2 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_list_distributions(self, m_request, base_absolut_url):
),
)
@mock.patch("crowdin_api.requester.APIRequester.request")
def test_add_distribution(self, m_request, incoming_data, request_data, base_absolut_url):
def test_add_distribution(self, m_request, incoming_data, request_data, base_absolut_url):
m_request.return_value = "response"
resource = self.get_resource(base_absolut_url)
assert resource.add_distribution(projectId=1, **incoming_data) == "response"
Expand Down
1 change: 0 additions & 1 deletion crowdin_api/api_resources/translation_memory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__pdoc__ = {'tests': False}

1 change: 0 additions & 1 deletion crowdin_api/api_resources/users/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__pdoc__ = {'tests': False}

4 changes: 2 additions & 2 deletions crowdin_api/api_resources/users/tests/test_users_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_invite_user(self, m_request, in_params, request_params, base_absolut_ur
resource = self.get_resource(base_absolut_url)
assert resource.invite_user(**in_params) == "response"
m_request.assert_called_once_with(
method="post", path="users", request_data=request_params
method="post", path="users", request_data=request_params
)

@pytest.mark.parametrize(
Expand All @@ -194,7 +194,7 @@ def test_edit_user(self, m_request, in_params, request_params, base_absolut_url)
resource = self.get_resource(base_absolut_url)
assert resource.edit_user(userId=1, data=in_params) == "response"
m_request.assert_called_once_with(
method="patch", path="users/1", request_data=request_params
method="patch", path="users/1", request_data=request_params
)

@mock.patch("crowdin_api.requester.APIRequester.request")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_get_workflow_steps_path(self, incoming_data, path, base_absolut_url):
({"templateId": 1}, "workflow-templates/1"),
),
)
def test_get_workflow_steps_path(self, incoming_data, path, base_absolut_url):
def test_get_workflow_templates_path(self, incoming_data, path, base_absolut_url):

resource = self.get_resource(base_absolut_url)
assert resource.get_workflow_templates_path(**incoming_data) == path
Expand Down
1 change: 0 additions & 1 deletion crowdin_api/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
class PlatformType(Enum):
BASIC = auto()
ENTERPRISE = auto()

7 changes: 6 additions & 1 deletion crowdin_api/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ class TestClient(CrowdinClient):
),
)
def test_url_with_instance(self, http_protocol, organization, base_url, result):
client = CrowdinClient(http_protocol=http_protocol, base_url=base_url, organization=organization)
client = CrowdinClient(
http_protocol=http_protocol,
base_url=base_url,
organization=organization
)

assert client.url == result

@pytest.mark.parametrize(
Expand Down
10 changes: 6 additions & 4 deletions crowdin_api/tests/test_requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ def test__clear_data(self, in_data, out_data, base_absolut_url):
assert requester._clear_data(in_data) == out_data

@mock.patch("crowdin_api.requester.APIRequester.request")
@pytest.mark.parametrize('kwargs', (
@pytest.mark.parametrize(
"kwargs",
(
{"k_1": "v_1"},
{"k_2": "v_2",
"k_3": "v_3"},
))
{"k_2": "v_2", "k_3": "v_3"}
)
)
def test_kwargs_in_requester(self, m_request, base_absolut_url, kwargs):
m_request.return_value = "response"
_requester = APIRequester(base_url=base_absolut_url)
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ doc8==0.8.1
pytest==6.2.2
pytest-cov==2.11.1
requests-mock==1.8.0
flake8
flake8==5.0.4
3 changes: 3 additions & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
wheel
setuptools

requests>=2.25.1