Skip to content

Commit 9044edd

Browse files
Tests: update branch name tests to include pid suffix
1 parent 22332cb commit 9044edd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_options.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
import uuid
23

34
import numpy as np
45
import pytest
@@ -90,7 +91,7 @@ def test_branch_name(clean_repo):
9091
new_branch = clean_repo.get_new_output_branch_name()
9192

9293
escaped_branch = re.escape(active_branch)
93-
pattern = rf"^\d{{4}}-\d{{2}}-\d{{2}}_\d{{2}}-\d{{2}}-\d{{2}}_{escaped_branch}_{hash}$"
94+
pattern = rf"^\d{{4}}-\d{{2}}-\d{{2}}_\d{{2}}-\d{{2}}-\d{{2}}_{escaped_branch}_{hash}_[0-9a-f]{{6}}$"
9495
assert re.match(pattern, new_branch), f"Branch name '{new_branch}' does not match expected format"
9596

9697

@@ -107,7 +108,7 @@ def test_branch_name_with_prefix(clean_repo):
107108
new_branch = clean_repo.get_new_output_branch_name(options.branch_prefix)
108109

109110
escaped_branch = re.escape(active_branch)
110-
pattern = rf"^Test_Prefix_\d{{4}}-\d{{2}}-\d{{2}}_\d{{2}}-\d{{2}}-\d{{2}}_{escaped_branch}_{hash}$"
111+
pattern = rf"^Test_Prefix_\d{{4}}-\d{{2}}-\d{{2}}_\d{{2}}-\d{{2}}-\d{{2}}_{escaped_branch}_{hash}_[0-9a-f]{{6}}$"
111112
assert re.match(pattern, new_branch), f"Branch name '{new_branch}' does not match expected format"
112113

113114

0 commit comments

Comments
 (0)