Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): Adds integration testing to the private registry auth feature (DOCKER_AUTH_CONFIG) #582

Merged
merged 10 commits into from
May 27, 2024

Conversation

Tranquility2
Copy link
Contributor

Follow up on #566 - Testing using the registry module

@Tranquility2
Copy link
Contributor Author

Also fiddled with

+from unittest import mock
+
 from docker.errors import NotFound

 from testcontainers.core.container import DockerContainer
 from testcontainers.core.docker_client import DockerClient
 from testcontainers.core.waiting_utils import wait_container_is_ready
+from testcontainers.core.config import testcontainers_config as c

 from testcontainers.registry import DockerRegistryContainer

@@ -31,8 +34,7 @@ def test_missing_on_private_registry(monkeypatch):
         # prepare auth config
         creds: bytes = base64.b64encode(f"{username}:{password}".encode("utf-8"))
         config = {"auths": {f"{registry_url}": {"auth": creds.decode("utf-8")}}}
-        monkeypatch.setenv("DOCKER_AUTH_CONFIG", json.dumps(config))
-        assert os.environ.get("DOCKER_AUTH_CONFIG"), "DOCKER_AUTH_CONFIG not set"
+        mock.patch.object(c, "_docker_auth_config", json.dumps(config))

@alexanderankin alexanderankin changed the title Private registry (integration Testing) chore(core): Private registry (integration Testing) May 27, 2024
@alexanderankin alexanderankin changed the title chore(core): Private registry (integration Testing) chore(core): Adds integration testing to the private registry auth feature (DOCKER_AUTH_CONFIG) May 27, 2024
@alexanderankin alexanderankin merged commit 78b6f0e into testcontainers:main May 27, 2024
7 checks passed
@Tranquility2
Copy link
Contributor Author

Nicely done @alexanderankin , thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants