From 037b608c14229e8297e072cd04ee530dd94802fe Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Thu, 14 Sep 2023 18:11:59 -0400 Subject: [PATCH] Correct regexp in test The second group is optional. Examples: label_in:indeed label_quickly:wall|label_market:hear --- tests/test_ocp_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_ocp_generator.py b/tests/test_ocp_generator.py index 2c68beed..999b2728 100644 --- a/tests/test_ocp_generator.py +++ b/tests/test_ocp_generator.py @@ -273,7 +273,7 @@ def test_gen_openshift_labels(self): """Test that gen_openshift_labels creates well-formatted labels.""" generator = OCPGenerator(self.two_hours_ago, self.now, {}) out_labels = generator._gen_openshift_labels() - matcher = r"(\w+:\w+)(\|(\w+:\w+))+" + matcher = r"(\w+:\w+)((\|(\w+:\w+))+)?" self.assertRegex(out_labels, matcher) def test_gen_pods_with_namespaces(self):