Skip to content
Open
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.9.0
rev: 26.1.0
hooks:
- id: black
args: ["--line-length", "100"]

- repo: https://github.com/PyCQA/isort
rev: 6.1.0
rev: 7.0.0
hooks:
- id: isort
files: \.py$
Expand Down
24 changes: 8 additions & 16 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,43 @@
@pytest.fixture
def cluster_ca_file(tmpdir) -> str:
cluster_ca_file = tmpdir.join("cluster_ca_file")
cluster_ca_file.write(
"""
cluster_ca_file.write("""
-----BEGIN CERTIFICATE-----
NotARealCertificate==
-----END CERTIFICATE-----
"""
)
""")
yield str(cluster_ca_file)
cluster_ca_file.remove()


@pytest.fixture
def client_ca_file(tmpdir) -> str:
client_ca_file = tmpdir.join("client_ca_file")
client_ca_file.write(
"""
client_ca_file.write("""
-----BEGIN CERTIFICATE-----
NotARealCertificate==
-----END CERTIFICATE-----
"""
)
""")
yield str(client_ca_file)
client_ca_file.remove()


@pytest.fixture
def client_key_file(tmpdir) -> str:
client_key_file = tmpdir.join("client_key_file")
client_key_file.write(
"""
client_key_file.write("""
-----BEGIN CERTIFICATE-----
NotARealCertificate==
-----END CERTIFICATE-----
"""
)
""")
yield str(client_key_file)
client_key_file.remove()


@pytest.fixture
def k8s_config_path(tmpdir, client_key_file, client_ca_file, cluster_ca_file):
k8s_config_path = tmpdir.join("k8s_config")
k8s_config_path.write(
f"""
k8s_config_path.write(f"""
apiVersion: v1
clusters:
- cluster:
Expand All @@ -75,7 +68,6 @@ def k8s_config_path(tmpdir, client_key_file, client_ca_file, cluster_ca_file):
user:
client-certificate: {client_ca_file}
client-key: {client_key_file}
"""
)
""")
yield k8s_config_path
k8s_config_path.remove()