From c8a9165293e5885fcb75d17ee612fe916faff339 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Sun, 29 Sep 2019 18:34:36 -0500 Subject: [PATCH] Remove warnings from tests These warnings are related to bugs which are fully fixed. --- test/test_enter.py | 16 ++++------------ test/test_perms.py | 11 ----------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/test/test_enter.py b/test/test_enter.py index 202df32..469e3ee 100644 --- a/test/test_enter.py +++ b/test/test_enter.py @@ -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( diff --git a/test/test_perms.py b/test/test_perms.py index eb7ad8f..ddf5260 100644 --- a/test/test_perms.py +++ b/test/test_perms.py @@ -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