Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 tests fail if /usr/local/share does not exist #562

Closed
ceamac opened this issue Dec 31, 2021 · 1 comment · Fixed by #567
Closed

2 tests fail if /usr/local/share does not exist #562

ceamac opened this issue Dec 31, 2021 · 1 comment · Fixed by #567
Labels
bug Something isn't working

Comments

@ceamac
Copy link

ceamac commented Dec 31, 2021

Describe the bug

There are tests that use /usr/local/share as a path that exists on all Unix systems. Gentoo does not have that path created by default. This causes the tests to fail.

To Reproduce

Remove (or rename) /usr/local/share and run the tests.


    def test_path_exists_case_insensitive():
    
        # choose a path which exists on all Unix systems
        path = "/usr/local/share"
    
        assert denormalize_path(path) == path
>       assert denormalize_path(path.title()) == path
E       AssertionError: assert '/usr/local/Share' == '/usr/local/share'
E         - /usr/local/share
E         ?            ^
E         + /usr/local/Share
E         ?            ^

path       = '/usr/local/share'

tests/offline/utils/test_path.py:23: AssertionError
___________________________________________________________________________________________ test_cased_path_candidates ____________________________________________________________________________________________

    def test_cased_path_candidates():
    
        # test that we can find a unique correctly cased path
        # starting from a candidate with scrambled casing
    
        path = "/usr/local/share".upper()
        candidates = equivalent_path_candidates(path)
    
        assert len(candidates) == 1
>       assert "/usr/local/share" in candidates
E       AssertionError: assert '/usr/local/share' in ['/usr/local/SHARE']

candidates = ['/usr/local/SHARE']
path       = '/USR/LOCAL/SHARE'

tests/offline/utils/test_path.py:47: AssertionError

Expected behaviour

Tests should pass.

System:

  • Maestral version: 1.5.2
  • Python version: 3.9.9
  • OS: [e.g. Ubuntu] Gentoo
  • Desktop environment: [e.g. Gnome 3.32] Gnome 40.0
  • PyQt version (for Linux GUI): 5.15.4

Additional context

I suggest using /usr/bin or /usr/share instead.

@ceamac ceamac added the bug Something isn't working label Dec 31, 2021
@samschott
Copy link
Owner

Oh, good catch! You live and learn :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants