Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
twm committed Jul 16, 2024
1 parent 16f6eff commit 410e6f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/unit/oidc/forms/test_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def check_project_name(name):
assert form._check_project_name == check_project_name
assert form.validate()

def test_validate_project_name_already_in_use(self):
@pytest.mark.parametrize("reason", list(ProjectNameUnavailableReason))
def test_validate_project_name_unavailable(self, reason):
form = github.PendingGitHubPublisherForm(
api_token="fake-token",
check_project_name=lambda name: ProjectNameUnavailableReason.AlreadyExists,
check_project_name=lambda name: reason,
)

field = pretend.stub(data="some-project")
Expand Down
2 changes: 0 additions & 2 deletions warehouse/packaging/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,6 @@ def create_project(
projecthelp=request.help_url(_anchor="project-name"),
),
) from None
case None:
pass

# The project name is valid: create it and add it
project = Project(name=name)
Expand Down

0 comments on commit 410e6f2

Please sign in to comment.