Skip to content

Commit 466c494

Browse files
author
bstrausser
committed
Change label names
1 parent bf9527b commit 466c494

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

core/testcontainers/core/labels.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from testcontainers.core.config import testcontainers_config as c
66

77
SESSION_ID: str = str(uuid4())
8-
TEST_CONTAINERS_NAMESPACE = "org.testcontainers"
8+
TESTCONTAINERS_NAMESPACE = "org.testcontainers"
99

10-
LABEL_TEST_CONTAINERS = TEST_CONTAINERS_NAMESPACE
10+
LABEL_TESTCONTAINERS = TESTCONTAINERS_NAMESPACE
1111
LABEL_SESSION_ID = "org.testcontainers.session-id"
1212
LABEL_VERSION = "org.testcontainers.version"
1313
LABEL_LANG = "org.testcontainers.lang"
@@ -18,11 +18,11 @@ def create_labels(image: str, labels: Optional[dict[str, str]]) -> dict[str, str
1818
labels = {}
1919
else:
2020
for k in labels:
21-
if k.startswith(TEST_CONTAINERS_NAMESPACE):
21+
if k.startswith(TESTCONTAINERS_NAMESPACE):
2222
raise ValueError("The org.testcontainers namespace is reserved for interal use")
2323

2424
labels[LABEL_LANG] = "python"
25-
labels[LABEL_TEST_CONTAINERS] = "true"
25+
labels[LABEL_TESTCONTAINERS] = "true"
2626
labels[LABEL_VERSION] = importlib.metadata.version("testcontainers")
2727

2828
if image == c.ryuk_image:

core/tests/test_labels.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from testcontainers.core.labels import (
22
LABEL_LANG,
33
LABEL_SESSION_ID,
4-
LABEL_TEST_CONTAINERS,
4+
LABEL_TESTCONTAINERS,
55
LABEL_VERSION,
66
create_labels,
7-
TEST_CONTAINERS_NAMESPACE,
7+
TESTCONTAINERS_NAMESPACE,
88
)
99
import pytest
1010
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
1818

1919
testdata = [
2020
(LABEL_LANG, "python", True),
21-
(LABEL_TEST_CONTAINERS, "true", True),
21+
(LABEL_TESTCONTAINERS, "true", True),
2222
(LABEL_SESSION_ID, "some", False),
2323
(LABEL_VERSION, "some", False),
2424
]
@@ -33,7 +33,7 @@ def test_containers_creates_expected_labels(label, value, known_before_test_time
3333
def test_containers_throws_on_namespace_collision():
3434

3535
with pytest.raises(ValueError):
36-
create_labels("not-ryuk", {TEST_CONTAINERS_NAMESPACE: "fake"})
36+
create_labels("not-ryuk", {TESTCONTAINERS_NAMESPACE: "fake"})
3737

3838

3939
def test_containers_respect_custom_labels_if_no_collision():

0 commit comments

Comments
 (0)