Remove warnings from tests
These warnings are related to bugs which are fully fixed.
This commit is contained in:
parent
3ba17f41fd
commit
c8a9165293
2 changed files with 4 additions and 23 deletions
|
@ -1,13 +1,12 @@
|
||||||
"""Test enter"""
|
"""Test enter"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import warnings
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
'shell, success', [
|
'shell, success', [
|
||||||
('delete', True),
|
('delete', True), # if there is no shell variable, bash creates it
|
||||||
('', False),
|
('', False),
|
||||||
('/usr/bin/env', True),
|
('/usr/bin/env', True),
|
||||||
('noexec', False),
|
('noexec', False),
|
||||||
|
@ -33,6 +32,7 @@ def test_enter(runner, yadm_y, paths, shell, success):
|
||||||
env['SHELL'] = str(noexec)
|
env['SHELL'] = str(noexec)
|
||||||
else:
|
else:
|
||||||
env['SHELL'] = shell
|
env['SHELL'] = shell
|
||||||
|
|
||||||
run = runner(command=yadm_y('enter'), env=env)
|
run = runner(command=yadm_y('enter'), env=env)
|
||||||
assert run.success == success
|
assert run.success == success
|
||||||
assert run.err == ''
|
assert run.err == ''
|
||||||
|
@ -40,20 +40,12 @@ def test_enter(runner, yadm_y, paths, shell, success):
|
||||||
if success:
|
if success:
|
||||||
assert run.out.startswith('Entering yadm repo')
|
assert run.out.startswith('Entering yadm repo')
|
||||||
assert run.out.rstrip().endswith('Leaving yadm repo')
|
assert run.out.rstrip().endswith('Leaving yadm repo')
|
||||||
if shell == 'delete':
|
|
||||||
# When SHELL is empty (unlikely), it is attempted to be run anyway.
|
|
||||||
# This is a but which must be fixed.
|
|
||||||
warnings.warn('Unhandled bug: SHELL executed when empty', Warning)
|
|
||||||
else:
|
|
||||||
assert f'PROMPT={prompt}' in run.out
|
|
||||||
assert f'PS1={prompt}' in run.out
|
|
||||||
assert f'GIT_DIR={paths.repo}' in run.out
|
|
||||||
if not success:
|
if not success:
|
||||||
assert 'does not refer to an executable' in run.out
|
assert 'does not refer to an executable' in run.out
|
||||||
if 'env' in shell:
|
if 'env' in shell:
|
||||||
assert f'GIT_DIR={paths.repo}' in run.out
|
assert f'GIT_DIR={paths.repo}' in run.out
|
||||||
assert 'PROMPT=yadm shell' in run.out
|
assert f'PROMPT={prompt}' in run.out
|
||||||
assert 'PS1=yadm shell' in run.out
|
assert f'PS1={prompt}' in run.out
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
"""Test perms"""
|
"""Test perms"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import warnings
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,11 +46,6 @@ def test_perms(runner, yadm_y, paths, ds1, autoperms):
|
||||||
|
|
||||||
# these paths should be secured if processing perms
|
# these paths should be secured if processing perms
|
||||||
for private in privatepaths:
|
for private in privatepaths:
|
||||||
if '.p2' in private.basename or '.p4' in private.basename:
|
|
||||||
# Dot files within .ssh/.gnupg are not protected.
|
|
||||||
# This is a but which must be fixed
|
|
||||||
warnings.warn('Unhandled bug: private dot files', Warning)
|
|
||||||
continue
|
|
||||||
if autoperms == 'false':
|
if autoperms == 'false':
|
||||||
assert not oct(private.stat().mode).endswith('00'), (
|
assert not oct(private.stat().mode).endswith('00'), (
|
||||||
'Path should not be secured')
|
'Path should not be secured')
|
||||||
|
@ -94,11 +88,6 @@ def test_perms_control(runner, yadm_y, paths, ds1, sshperms, gpgperms):
|
||||||
|
|
||||||
# these paths should be secured if processing perms
|
# these paths should be secured if processing perms
|
||||||
for private in privatepaths:
|
for private in privatepaths:
|
||||||
if '.p2' in private.basename or '.p4' in private.basename:
|
|
||||||
# Dot files within .ssh/.gnupg are not protected.
|
|
||||||
# This is a but which must be fixed
|
|
||||||
warnings.warn('Unhandled bug: private dot files', Warning)
|
|
||||||
continue
|
|
||||||
if (
|
if (
|
||||||
(sshperms == 'false' and 'ssh' in str(private))
|
(sshperms == 'false' and 'ssh' in str(private))
|
||||||
or
|
or
|
||||||
|
|
Loading…
Reference in a new issue