Skip to content

Commit

Permalink
Both b2 and proper cli string are now allowed in licenses test
Browse files Browse the repository at this point in the history
This is because some versions, e.g. the docker one, have prebuilt
licenses and thus have it only in the `b2` version.
  • Loading branch information
kkalinowski-reef committed Dec 15, 2023
1 parent fde50f1 commit 2b55e39
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/integration/test_b2_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,8 +1515,12 @@ def test_license(b2_tool, with_packages, cli_version):
)

if with_packages:
# In the case of e.g.: docker image, it has a license built-in with a `b2`.
# It also is unable to generate this license because it lacks required packages.
# Thus, I'm allowing here for the test of licenses to pass whenever
# the binary is named `b2` or with the proper cli version string (e.g. `_b2v4` or `b2v3`).
full_license_re = re.compile(
fr'Licenses of all modules used by {cli_version}(\.EXE)?, shipped with it in binary form:\r?\n'
fr'Licenses of all modules used by ({cli_version}|b2)(\.EXE)?, shipped with it in binary form:\r?\n'
r'\+-*\+-*\+\r?\n'
r'\|\s*Module name\s*\|\s*License text\s*\|\r?\n'
r'.*'
Expand All @@ -1531,8 +1535,9 @@ def test_license(b2_tool, with_packages, cli_version):
# 'colorlog', 'virtualenv', 'nox', 'packaging', 'argcomplete', 'filelock'
# that sum up to around 50k characters. Tests ran from docker image are unaffected.

# See the explanation above for why both `b2` and `cli_version` are allowed here.
license_summary_re = re.compile(
fr'Summary of all modules used by {cli_version}(\.EXE)?, shipped with it in binary form:\r?\n'
fr'Summary of all modules used by ({cli_version}|b2)(\.EXE)?, shipped with it in binary form:\r?\n'
r'\+-*\+-*\+-*\+-*\+-*\+\r?\n'
r'\|\s*Module name\s*\|\s*Version\s*\|\s*License\s*\|\s*Author\s*\|\s*URL\s*\|\r?\n'
r'.*'
Expand Down

0 comments on commit 2b55e39

Please sign in to comment.