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

Allow spaces in rootdir when running tests #37

Merged
merged 2 commits into from
Jun 22, 2019

Conversation

moredatarequired
Copy link
Contributor

Small change to allow tests to pass when run from a directory that has spaces in the path.

Because I'm running from Ubuntu under Windows (WSL), my home directory is /mnt/c/Users/Wimberly Hugh and so when I try to run the project tests I run into the test failure:

add_to_index = <function add_to_index.<locals>.add_package at 0x7f1edda07158>

    def test_build_from_sdist(add_to_index):
        sdist_fname = os.path.join(here, "copyingmock-0.2.tar.gz")
        fragment = "#md5=9aa6ba13542d25e527fe358d53cdaf3b"
        add_to_index(name="copyingmock", path=sdist_fname, urlfragment=fragment)
        dist = JohnnyDist("copyingmock")
        assert dist.name == "copyingmock"
        assert dist.summary == "A subclass of MagicMock that copies the arguments"
        assert dist.required_by == []
        assert dist.import_names == ["copyingmock"]
        assert dist.homepage == "https://github.com/wimglenn/copyingmock"
        assert dist.extras_available == []
        assert dist.extras_requested == []
        assert dist.project_name == "copyingmock"
>       assert dist.download_link == "file://{}".format(sdist_fname)
E       AssertionError: assert 'file:///mnt/...ck-0.2.tar.gz' == 'file:///mnt/c...ck-0.2.tar.gz'
E         - file:///mnt/c/Users/Wimberly%20Hugh/git_repos/johnnydep/tests/copyingmock-0.2.tar.gz
E         ?                             ^^^
E         + file:///mnt/c/Users/Wimberly Hugh/git_repos/johnnydep/tests/copyingmock-0.2.tar.gz
E         ?                             ^

tests/test_gen.py:71: AssertionError

Small change to allow tests to pass when run from a directory that has spaces in the path.

Because I'm running from Ubuntu under Windows (WSL), my home directory is `/mnt/c/Users/Wimberly Hugh` and so when I try to run the project tests I run into the test failure:
```
add_to_index = <function add_to_index.<locals>.add_package at 0x7f1edda07158>

    def test_build_from_sdist(add_to_index):
        sdist_fname = os.path.join(here, "copyingmock-0.2.tar.gz")
        fragment = "#md5=9aa6ba13542d25e527fe358d53cdaf3b"
        add_to_index(name="copyingmock", path=sdist_fname, urlfragment=fragment)
        dist = JohnnyDist("copyingmock")
        assert dist.name == "copyingmock"
        assert dist.summary == "A subclass of MagicMock that copies the arguments"
        assert dist.required_by == []
        assert dist.import_names == ["copyingmock"]
        assert dist.homepage == "https://github.com/wimglenn/copyingmock"
        assert dist.extras_available == []
        assert dist.extras_requested == []
        assert dist.project_name == "copyingmock"
>       assert dist.download_link == "file://{}".format(sdist_fname)
E       AssertionError: assert 'file:///mnt/...ck-0.2.tar.gz' == 'file:///mnt/c...ck-0.2.tar.gz'
E         - file:///mnt/c/Users/Wimberly%20Hugh/git_repos/johnnydep/tests/copyingmock-0.2.tar.gz
E         ?                             ^^^
E         + file:///mnt/c/Users/Wimberly Hugh/git_repos/johnnydep/tests/copyingmock-0.2.tar.gz
E         ?                             ^

tests/test_gen.py:71: AssertionError
```
@wimglenn
Copy link
Owner

Hi @moredatarequired - this proj supports Python 2.7 as well. Please put cross-compat shims into johnnydep/compat.py for the url quoting.

@wimglenn wimglenn merged commit cb10eb4 into wimglenn:master Jun 22, 2019
@wimglenn
Copy link
Owner

thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants