Skip to content

Commit

Permalink
Harden test
Browse files Browse the repository at this point in the history
  • Loading branch information
josephine-wolf-oberholtzer committed Apr 15, 2024
1 parent 264d876 commit 9f23779
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/contexts/test_Server_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,17 @@ async def test_query_version(context):
stdout = completed_subprocess.stdout
line = completed_subprocess.stdout.splitlines()[0]
print(stdout, line)
(program_name, major, minor, patch, branch, commit) = re.match(
r"(\w+) (\d+)\.(\d+)(\.[\w-]+) \(Built from branch '([\W\w]+)' \[([\W\w]+)\]\)",
groups = re.match(
r"(\w+) (\d+)\.(\d+)(\.[\w-]+) \(Built from (?:branch|tag) '([\W\w]+)' \[([\W\w]+)\]\)",
line,
).groups()
program_name, major, minor, patch, ref, commit = groups
expected_info = VersionInfo(
program_name=program_name,
major=int(major),
minor=int(minor),
patch=patch,
branch=branch,
branch=ref,
commit=commit,
)
assert await get(context.query_version()) == expected_info
Expand Down

0 comments on commit 9f23779

Please sign in to comment.