Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 11, 2024
1 parent 6d00318 commit 87442fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
2 changes: 1 addition & 1 deletion binderhub/repoproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class RepoProvider(LoggingConfigurable):
1. it matches allowed_specs and does not match banned_specs or
2. allowed_specs is unspecified and the spec does not match banned_specs.
""",
config=True
config=True,
)

banned_specs = List(
Expand Down
40 changes: 10 additions & 30 deletions binderhub/tests/test_repoproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,66 +266,46 @@ def test_banned():

def test_allowed():
provider = GitHubRepoProvider(
spec='jupyterhub/zero-to-jupyterhub-k8s/v0.4',
allowed_specs=[
'^jupyterhub.*'
]
spec="jupyterhub/zero-to-jupyterhub-k8s/v0.4", allowed_specs=["^jupyterhub.*"]
)
assert not provider.is_banned()


def test_not_allowed():
provider = GitHubRepoProvider(
spec='jupyterhub/zero-to-jupyterhub-k8s/v0.4',
allowed_specs=[
'^yuvipanda.*'
]
spec="jupyterhub/zero-to-jupyterhub-k8s/v0.4", allowed_specs=["^yuvipanda.*"]
)
assert provider.is_banned()


def test_allowed_but_banned():
provider = GitHubRepoProvider(
spec='jupyterhub/zero-to-jupyterhub-k8s/v0.4',
allowed_specs=[
'^jupyterhub.*'
],
banned_specs=[
'.*zero-to-.*'
]
spec="jupyterhub/zero-to-jupyterhub-k8s/v0.4",
allowed_specs=["^jupyterhub.*"],
banned_specs=[".*zero-to-.*"],
)
assert provider.is_banned()


def test_allowed():
provider = GitHubRepoProvider(
spec='jupyterhub/zero-to-jupyterhub-k8s/v0.4',
allowed_specs=[
'^jupyterhub.*'
]
spec="jupyterhub/zero-to-jupyterhub-k8s/v0.4", allowed_specs=["^jupyterhub.*"]
)
assert not provider.is_banned()


def test_not_allowed():
provider = GitHubRepoProvider(
spec='jupyterhub/zero-to-jupyterhub-k8s/v0.4',
allowed_specs=[
'^yuvipanda.*'
]
spec="jupyterhub/zero-to-jupyterhub-k8s/v0.4", allowed_specs=["^yuvipanda.*"]
)
assert provider.is_banned()


def test_allowed_but_banned():
provider = GitHubRepoProvider(
spec='jupyterhub/zero-to-jupyterhub-k8s/v0.4',
allowed_specs=[
'^jupyterhub.*'
],
banned_specs=[
'.*zero-to-.*'
]
spec="jupyterhub/zero-to-jupyterhub-k8s/v0.4",
allowed_specs=["^jupyterhub.*"],
banned_specs=[".*zero-to-.*"],
)
assert provider.is_banned()

Expand Down

0 comments on commit 87442fb

Please sign in to comment.