From 2b55e3946940709c4be914c40ce9908490778c32 Mon Sep 17 00:00:00 2001 From: Krzysztof Kalinowski Date: Fri, 15 Dec 2023 14:17:52 +0400 Subject: [PATCH] Both b2 and proper cli string are now allowed in licenses test This is because some versions, e.g. the docker one, have prebuilt licenses and thus have it only in the `b2` version. --- test/integration/test_b2_command_line.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/integration/test_b2_command_line.py b/test/integration/test_b2_command_line.py index 038cd9c60..6efd510c0 100755 --- a/test/integration/test_b2_command_line.py +++ b/test/integration/test_b2_command_line.py @@ -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'.*' @@ -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'.*'