Skip to content

Commit

Permalink
chore: Run pre-commit linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Injabie3 committed Nov 13, 2023
1 parent dd5a9b7 commit fb14774
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ def parse_comma_separate_string_as_list(cls, v: str) -> list[str]:
@field_validator('image_names', mode='before')
def validate_image_names(cls, v: str, values: ValidationInfo) -> list[str]:
images = cls._parse_comma_separate_string_as_list(v)
if "token_type" in values.data:
token_type = values.data["token_type"]
if 'token_type' in values.data:
token_type = values.data['token_type']
if token_type == GithubTokenType.GITHUB_TOKEN and len(images) != 1:
raise ValueError('A single image name is required if token_type is github-token')
if token_type == GithubTokenType.GITHUB_TOKEN and '*' in images[0]:
Expand Down
3 changes: 2 additions & 1 deletion main_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ async def test_dry_run(self, mocker, capsys, http_client):

def test_inputs_bad_token_type():
with pytest.raises(ValidationError, match='Input should be \'github-token\' or \'pat\''):
_create_inputs_model(token_type='undefined-token-type', image_names="a,b")
_create_inputs_model(token_type='undefined-token-type', image_names='a,b')


def test_inputs_token_type_as_github_token_with_bad_image_names():
_create_inputs_model(image_names='a', token_type='github-token')
Expand Down

0 comments on commit fb14774

Please sign in to comment.