fix stickler errors

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>
This commit is contained in:
pvogt09 2020-12-27 21:16:37 +01:00
parent c465461ed4
commit af9f550e50
2 changed files with 7 additions and 5 deletions

View file

@ -100,7 +100,7 @@ def mock_command(script, args, container):
in unit tests
'''
full_script_path = '/usr/local/bin/{}'.format(script)
mock_script = dedent('''\
mock_script = dedent(r'''\
#!/bin/bash -e
echo "\$0 \$@" >> /var/log/{script}
case "\$1" in'''.format(script=script))
@ -127,7 +127,7 @@ def mock_command_run(script, args, container):
in unit tests
'''
full_script_path = '/usr/local/bin/{}'.format(script)
mock_script = dedent('''\
mock_script = dedent(r'''\
#!/bin/bash -e
echo "\$0 \$@" >> /var/log/{script}
case "\$1 \$2" in'''.format(script=script))
@ -154,7 +154,7 @@ def mock_command_2(script, args, container):
in unit tests
'''
full_script_path = '/usr/local/bin/{}'.format(script)
mock_script = dedent('''\
mock_script = dedent(r'''\
#!/bin/bash -e
echo "\$0 \$@" >> /var/log/{script}
case "\$1 \$2" in'''.format(script=script))

View file

@ -140,8 +140,8 @@ def get_directories_recursive(Pihole, directory):
ls = Pihole.run('ls -d {}'.format(directory + '/*/'))
directories = list(filter(bool, ls.stdout.splitlines()))
dirs = directories
for dir in directories:
dir_rec = get_directories_recursive(Pihole, dir)
for dirval in directories:
dir_rec = get_directories_recursive(Pihole, dirval)
if isinstance(dir_rec, str):
dirs.extend([dir_rec])
else:
@ -513,6 +513,8 @@ def test_installPihole_fresh_install_readableBlockpage(Pihole, test_webpage):
echo "INSTALL_WEB_SERVER=${INSTALL_WEB_SERVER}"
''')
assert 0 == installWeb.rc
testFTL = Pihole.run('pihole-FTL test')
assert 0 == testFTL.rc
piholeuser = 'pihole'
webuser = ''
user = re.findall(