Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
add live api test
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerdave committed Jan 2, 2017
1 parent a94c483 commit 5f7e51e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_live_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python
import os
import pytest
from click.testing import CliRunner

from bloomsky_api import cli

def is_travis_but_not_cron_or_api():
return os.environ.get('TRAVIS_EVENT_TYPE') not in ['api', 'cron', None]

@pytest.mark.skipif(is_travis_but_not_cron_or_api(),
reason='Running via Travis but not a cron')
class TestClickTutorial(object):

def setup_method(self):
self.runner = CliRunner()

# FIXME: check more of the output and define valid values via env vars
def test_outputs_api_response(self):
result = self.runner.invoke(cli.cli, [])
print(result.output)
assert '"street_name": "Lakeland Avenue"' in result.output

0 comments on commit 5f7e51e

Please sign in to comment.