diff --git a/core/testcontainers/core/labels.py b/core/testcontainers/core/labels.py index 474092952..927cdb361 100644 --- a/core/testcontainers/core/labels.py +++ b/core/testcontainers/core/labels.py @@ -5,9 +5,9 @@ from testcontainers.core.config import RYUK_IMAGE SESSION_ID: str = str(uuid4()) -TEST_CONTAINERS_NAMESPACE = "org.testcontainers" +TESTCONTAINERS_NAMESPACE = "org.testcontainers" -LABEL_TEST_CONTAINERS = TEST_CONTAINERS_NAMESPACE +LABEL_TESTCONTAINERS = TESTCONTAINERS_NAMESPACE LABEL_SESSION_ID = "org.testcontainers.session-id" LABEL_VERSION = "org.testcontainers.version" LABEL_LANG = "org.testcontainers.lang" @@ -18,11 +18,11 @@ def create_labels(image: str, labels: Optional[dict[str, str]]) -> dict[str, str labels = {} else: for k in labels: - if k.startswith(TEST_CONTAINERS_NAMESPACE): + if k.startswith(TESTCONTAINERS_NAMESPACE): raise ValueError("The org.testcontainers namespace is reserved for interal use") labels[LABEL_LANG] = "python" - labels[LABEL_TEST_CONTAINERS] = "true" + labels[LABEL_TESTCONTAINERS] = "true" labels[LABEL_VERSION] = importlib.metadata.version("testcontainers") if image == RYUK_IMAGE: diff --git a/core/tests/test_labels.py b/core/tests/test_labels.py index 924e0bdc7..ea1fd4a14 100644 --- a/core/tests/test_labels.py +++ b/core/tests/test_labels.py @@ -1,10 +1,10 @@ from testcontainers.core.labels import ( LABEL_LANG, LABEL_SESSION_ID, - LABEL_TEST_CONTAINERS, + LABEL_TESTCONTAINERS, LABEL_VERSION, create_labels, - TEST_CONTAINERS_NAMESPACE, + TESTCONTAINERS_NAMESPACE, ) import pytest from testcontainers.core.config import RYUK_IMAGE @@ -18,7 +18,7 @@ def assert_in_with_value(labels: dict, label: str, value: str, known_before_test testdata = [ (LABEL_LANG, "python", True), - (LABEL_TEST_CONTAINERS, "true", True), + (LABEL_TESTCONTAINERS, "true", True), (LABEL_SESSION_ID, "some", False), (LABEL_VERSION, "some", False), ] @@ -33,7 +33,7 @@ def test_containers_creates_expected_labels(label, value, known_before_test_time def test_containers_throws_on_namespace_collision(): with pytest.raises(ValueError): - create_labels("not-ryuk", {TEST_CONTAINERS_NAMESPACE: "fake"}) + create_labels("not-ryuk", {TESTCONTAINERS_NAMESPACE: "fake"}) def test_containers_respect_custom_labels_if_no_collision():