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

Add system test for 'Metric.update'. #1613

Merged
merged 1 commit into from
Mar 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions system_tests/logging_.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,20 @@ def test_reload_metric(self):
metric.reload()
self.assertEqual(metric.filter_, DEFAULT_FILTER)
self.assertEqual(metric.description, DEFAULT_DESCRIPTION)

def test_update_metric(self):
NEW_FILTER = 'logName:other'
NEW_DESCRIPTION = 'updated'
metric = Config.CLIENT.metric(
DEFAULT_METRIC_NAME, DEFAULT_FILTER, DEFAULT_DESCRIPTION)
self.assertFalse(metric.exists())
metric.create()
self.to_delete.append(metric)
metric.filter_ = NEW_FILTER
metric.description = NEW_DESCRIPTION
metric.update()
after_metrics, _ = Config.CLIENT.list_metrics()
after_info = dict((metric.name, metric) for metric in after_metrics)
after = after_info[DEFAULT_METRIC_NAME]
self.assertEqual(after.filter_, NEW_FILTER)
self.assertEqual(after.description, NEW_DESCRIPTION)