Skip to content

Commit

Permalink
Merge pull request #54 from mapbox/token-case
Browse files Browse the repository at this point in the history
tests should not fight with user's MAPBOX_ACCESS_TOKEN
  • Loading branch information
sgillies committed Feb 22, 2016
2 parents 99b247d + f5ffe5b commit e1a0498
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ def test_config_envvar(monkeypatch):
def test_config_envvar_2(monkeypatch):
"""Get access token from MapboxAccessToken."""
monkeypatch.setenv('MapboxAccessToken', 'pk.test_config_envvar_2')
monkeypatch.delenv('MAPBOX_ACCESS_TOKEN', raising=False)
runner = CliRunner()
result = runner.invoke(main_group, ['config'], catch_exceptions=False)
assert "Config file" not in result.output
assert "access-token = pk.test_config_envvar_2" in result.output
assert "MapboxAccessToken = pk.test_config_envvar_2" in result.output
assert "access-token = pk.test_config_envvar_2" in result.output
monkeypatch.undo()


Expand Down
4 changes: 2 additions & 2 deletions tests/test_geocoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_cli_geocode_fwd_env_token():
result = runner.invoke(
main_group,
['geocoding', '--forward', '1600 pennsylvania ave nw'],
env={'MapboxAccessToken': 'bogus'})
env={'MAPBOX_ACCESS_TOKEN': 'bogus'})
assert result.exit_code == 0
assert result.output == '{"query": ["1600", "pennsylvania", "ave", "nw"]}\n'

Expand Down Expand Up @@ -89,7 +89,7 @@ def test_cli_geocode_reverse_env_token():
main_group,
['geocoding', '--reverse'],
input='{0},{1}'.format(lon, lat),
env={'MapboxAccessToken': 'bogus'})
env={'MAPBOX_ACCESS_TOKEN': 'bogus'})
assert result.exit_code == 0
assert result.output.strip() == body

Expand Down

0 comments on commit e1a0498

Please sign in to comment.