Skip to content

Commit

Permalink
Merge pull request #191 from GoogleCloudPlatform/pytest-monitoring
Browse files Browse the repository at this point in the history
Moving monitoring samples to py.test
  • Loading branch information
Jon Wayne Parrott committed Feb 18, 2016
2 parents 2041ffd + 75fa390 commit 64812dd
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions monitoring/api/auth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
import re

import auth
import testing


class TestTimeseriesList(testing.CloudTest):
def test_main(cloud_config, capsys):
auth.main(cloud_config.GCLOUD_PROJECT)
output, _ = capsys.readouterr()

def test_main(self):
with testing.capture_stdout() as stdout:
auth.main(self.config.GCLOUD_PROJECT)

output = stdout.getvalue().strip()

self.assertRegexpMatches(
output, re.compile(r'Timeseries.list raw response:\s*'
r'{\s*"kind": "[^"]+",'
r'\s*"oldest": *"[0-9]+', re.S))
assert re.search(
re.compile(
r'Timeseries.list raw response:\s*'
r'{\s*"kind": "[^"]+",'
r'\s*"oldest": *"[0-9]+', re.S),
output)

0 comments on commit 64812dd

Please sign in to comment.