Skip to content

Commit

Permalink
chore: lint cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
0x6f677548 committed Oct 25, 2023
1 parent c9bdea7 commit 4f28955
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ classifiers = [
dependencies = [
"requests>=2.31.0",
"msal>=1.24.1",
"click>=8.1.7"
"click>=8.1.7",
"types-requests>=2.31.0",
]

[project.scripts]
Expand Down
5 changes: 3 additions & 2 deletions src/ca_pwt/authentication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from typing import Callable
from msal import PublicClientApplication, ConfidentialClientApplication

_common_tenant_id = "common"
Expand Down Expand Up @@ -138,8 +139,8 @@ def acquire_token_by_username_password(


def acquire_token_by_device_flow(
stdout_callback: callable,
stdout_flush: callable,
stdout_callback: Callable,
stdout_flush: Callable,
client_id: str = _default_client_id,
tenant_id: str = _common_tenant_id,
scopes: list[str] = _default_scopes,
Expand Down
2 changes: 1 addition & 1 deletion src/ca_pwt/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def import_groups_cmd(
input_file = _get_from_ctx_if_none(ctx, "output_file", input_file, lambda: click.prompt("The input file"))
click.echo(f"Input file: {input_file}")
groups = load_groups(input_file)
created_groups = import_groups(access_token, groups, allow_duplicates)
created_groups = import_groups(access_token, groups, allow_duplicates=allow_duplicates)
click.echo("Successfully created groups:")
for group in created_groups:
click.echo(f"{group[0]}: {group[1]}")
Expand Down
2 changes: 1 addition & 1 deletion src/ca_pwt/helpers/graph_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, request_response: requests.Response, expected_status_code: in
the success property will be set to True
"""
self.status_code = request_response.status_code
self.response = request_response
self.response: requests.Response | str = request_response
self.expected_status_code = expected_status_code
self.success = self.status_code == self.expected_status_code
if self._logger.isEnabledFor(logging.DEBUG):
Expand Down
5 changes: 4 additions & 1 deletion src/ca_pwt/helpers/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
def assert_condition(condition: any, message: str):
from typing import Any


def assert_condition(condition: Any, message: str):
"""Asserts a condition and raises an AssertionError if it is False"""
if not condition:
raise AssertionError(message)
4 changes: 2 additions & 2 deletions tests/test_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flake8: noqa: E501
valid_policies: dict = [
valid_policies: list[dict] = [
{
"id": "88ef8435-6ab4-42c5-8e8d-e5dc2d1d66a9",
"displayName": "TEST-POLICY",
Expand Down Expand Up @@ -41,7 +41,7 @@
}
]

invalid_policies: dict = [
invalid_policies: list[dict] = [
{
"displayNames": "ca-test",
"conditions": {
Expand Down

0 comments on commit 4f28955

Please sign in to comment.