This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|