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

Tests fail when MAPBOX_ACCESS_TOKEN is set #33

Closed
perrygeo opened this issue Dec 18, 2015 · 2 comments · Fixed by #54
Closed

Tests fail when MAPBOX_ACCESS_TOKEN is set #33

perrygeo opened this issue Dec 18, 2015 · 2 comments · Fixed by #54
Milestone

Comments

@perrygeo
Copy link
Contributor

        result = runner.invoke(
            main_group,
            ['geocoding', '--reverse'],
            input='{0},{1}'.format(lon, lat),
            env={'MapboxAccessToken': 'bogus'})
>       assert result.exit_code == 0
E       assert -1 == 0
E        +  where -1 = <Result ConnectionError(u'Connection refused: GET https://api.mapbox.com/geoco...123xyz',)>.exit_code

tests/test_geocoding.py:93: AssertionError

where MAPBOX_ACCESS_TOKEN=123xyz is set in my environment. If I unset MAPBOX_ACCESS_TOKEN it works.

@sgillies is this just a matter of MAPBOX_ACCESS_TOKEN taking precedence over MapboxAccessToken?

@sgillies
Copy link
Contributor

@perrygeo yes. I want our customers to use all caps envars (priniciple of least surprise). Internally, however, many of us have MapboxAccessToken because of cloud formation. I'm going to push a commit that makes precedence more clear.

@perrygeo perrygeo reopened this Feb 15, 2016
@perrygeo
Copy link
Contributor Author

This issue still persists. The tests should pass even if a developer's MAPBOX_ACCESS_TOKEN is set. Sending a PR shortly.

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

Successfully merging a pull request may close this issue.

2 participants