diff options
author | Stéphane Bidoul (ACSONE) <stephane.bidoul@acsone.eu> | 2018-05-11 15:37:11 +0200 |
---|---|---|
committer | Stéphane Bidoul (ACSONE) <stephane.bidoul@acsone.eu> | 2018-05-11 15:37:32 +0200 |
commit | 9304e4bdf6b6312ca41fe2775b292e97f636dc81 (patch) | |
tree | 531794583c6bc66b6730c4b0296f9c5e7b2e718e | |
parent | ad48d5c1b6e3d6e759c3e602b1ce9f976b84a7d3 (diff) | |
download | setuptools-scm-9304e4bdf6b6312ca41fe2775b292e97f636dc81.tar.gz |
Improve file finder test coverage
-rw-r--r-- | testing/test_file_finder.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/test_file_finder.py b/testing/test_file_finder.py index 830deaa..2ab5541 100644 --- a/testing/test_file_finder.py +++ b/testing/test_file_finder.py @@ -85,6 +85,15 @@ def test_symlink_dir(inwd): @pytest.mark.skipif(sys.platform == 'win32', + reason="symlinks to dir not supported") +def test_symlink_dir_source_not_in_scm(inwd): + (inwd.cwd / 'adir' / 'bdirlink').mksymlinkto('../bdir') + assert set(find_files('adir')) == _sep({ + 'adir/filea', + }) + + +@pytest.mark.skipif(sys.platform == 'win32', reason="symlinks to files not supported on windows") def test_symlink_file(inwd): (inwd.cwd / 'adir' / 'file1link').mksymlinkto('../file1') @@ -96,6 +105,15 @@ def test_symlink_file(inwd): @pytest.mark.skipif(sys.platform == 'win32', + reason="symlinks to files not supported on windows") +def test_symlink_file_source_not_in_scm(inwd): + (inwd.cwd / 'adir' / 'file1link').mksymlinkto('../file1') + assert set(find_files('adir')) == _sep({ + 'adir/filea', + }) + + +@pytest.mark.skipif(sys.platform == 'win32', reason="symlinks to dir not supported") def test_symlink_loop(inwd): (inwd.cwd / 'adir' / 'loop').mksymlinkto('../adir') @@ -108,6 +126,18 @@ def test_symlink_loop(inwd): @pytest.mark.skipif(sys.platform == 'win32', reason="symlinks to dir not supported") +def test_symlink_loop_outside_path(inwd): + (inwd.cwd / 'bdir' / 'loop').mksymlinkto('../bdir') + (inwd.cwd / 'adir' / 'bdirlink').mksymlinkto('../bdir') + inwd.add_and_commit() + assert set(find_files('adir')) == _sep({ + 'adir/filea', + 'adir/bdirlink/fileb', + }) + + +@pytest.mark.skipif(sys.platform == 'win32', + reason="symlinks to dir not supported") def test_symlink_dir_out_of_git(inwd): (inwd.cwd / 'adir' / 'outsidedirlink').\ mksymlinkto(os.path.join(__file__, '..')) |