Commit dc8272b5 authored by Jérome Perrin's avatar Jérome Perrin

test_check_software: update test to follow vulnerability database update

The vulnerability that this test was checking was removed from the
database, let's use another one that looks more likely to be removed.
parent 88bdb2d7
Pipeline #20576 failed with stage
in 0 seconds
...@@ -157,19 +157,19 @@ class TestCheckSoftwareEggVulnerability(SlapOSStandaloneTestCase): ...@@ -157,19 +157,19 @@ class TestCheckSoftwareEggVulnerability(SlapOSStandaloneTestCase):
) )
eggs_dir = os.path.join(software_dir, 'eggs') eggs_dir = os.path.join(software_dir, 'eggs')
os.makedirs(os.path.join(eggs_dir, 'Werkzeug-1.0.1-py3.7.egg', 'EGG-INFO')) os.makedirs(os.path.join(eggs_dir, 'urllib3-1.22-py3.7.egg', 'EGG-INFO'))
with open( with open(
os.path.join( os.path.join(
eggs_dir, eggs_dir,
'Werkzeug-1.0.1-py3.7.egg', 'urllib3-1.22-py3.7.egg',
'EGG-INFO', 'EGG-INFO',
'PKG-INFO', 'PKG-INFO',
), 'w') as f: ), 'w') as f:
f.write( f.write(
textwrap.dedent('''\ textwrap.dedent('''\
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: Werkzeug Name: urllib3
Version: 1.0.1 Version: 1.22
''')) '''))
develop_eggs_dir = os.path.join(software_dir, 'develop-eggs') develop_eggs_dir = os.path.join(software_dir, 'develop-eggs')
...@@ -206,7 +206,7 @@ class TestCheckSoftwareEggVulnerability(SlapOSStandaloneTestCase): ...@@ -206,7 +206,7 @@ class TestCheckSoftwareEggVulnerability(SlapOSStandaloneTestCase):
warning, = [w for w in warning_context if 'vulnerable' in str(w.message)] warning, = [w for w in warning_context if 'vulnerable' in str(w.message)]
self.assertIn( self.assertIn(
'Werkzeug version 2.0.2 improves the security of the debugger cookies', 'urllib3 before version 1.23 does not remove the Authorization HTTP header when',
str(warning.message), str(warning.message),
) )
self.assertIn( self.assertIn(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment