1
0
Fork 0
mirror of synced 2024-12-13 02:45:45 -05:00

Remove warnings from tests

These warnings are related to bugs which are fully fixed.
This commit is contained in:
Tim Byrne 2019-09-29 18:34:36 -05:00
parent 3ba17f41fd
commit c8a9165293
No known key found for this signature in database
GPG key ID: 14DB4FC2465A4B12
2 changed files with 4 additions and 23 deletions

View file

@ -1,13 +1,12 @@
"""Test enter"""
import os
import warnings
import pytest
@pytest.mark.parametrize(
'shell, success', [
('delete', True),
('delete', True), # if there is no shell variable, bash creates it
('', False),
('/usr/bin/env', True),
('noexec', False),
@ -33,6 +32,7 @@ def test_enter(runner, yadm_y, paths, shell, success):
env['SHELL'] = str(noexec)
else:
env['SHELL'] = shell
run = runner(command=yadm_y('enter'), env=env)
assert run.success == success
assert run.err == ''
@ -40,20 +40,12 @@ def test_enter(runner, yadm_y, paths, shell, success):
if success:
assert run.out.startswith('Entering 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:
assert 'does not refer to an executable' in run.out
if 'env' in shell:
assert f'GIT_DIR={paths.repo}' in run.out
assert 'PROMPT=yadm shell' in run.out
assert 'PS1=yadm shell' in run.out
assert f'PROMPT={prompt}' in run.out
assert f'PS1={prompt}' in run.out
@pytest.mark.parametrize(

View file

@ -1,7 +1,6 @@
"""Test perms"""
import os
import warnings
import pytest
@ -47,11 +46,6 @@ def test_perms(runner, yadm_y, paths, ds1, autoperms):
# these paths should be secured if processing perms
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':
assert not oct(private.stat().mode).endswith('00'), (
'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
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 (
(sshperms == 'false' and 'ssh' in str(private))
or