File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -106,3 +106,20 @@ def test_reload_metric(self):
106106 metric .reload ()
107107 self .assertEqual (metric .filter_ , DEFAULT_FILTER )
108108 self .assertEqual (metric .description , DEFAULT_DESCRIPTION )
109+
110+ def test_update_metric (self ):
111+ NEW_FILTER = 'logName:other'
112+ NEW_DESCRIPTION = 'updated'
113+ metric = Config .CLIENT .metric (
114+ DEFAULT_METRIC_NAME , DEFAULT_FILTER , DEFAULT_DESCRIPTION )
115+ self .assertFalse (metric .exists ())
116+ metric .create ()
117+ self .to_delete .append (metric )
118+ metric .filter_ = NEW_FILTER
119+ metric .description = NEW_DESCRIPTION
120+ metric .update ()
121+ after_metrics , _ = Config .CLIENT .list_metrics ()
122+ after_info = dict ((metric .name , metric ) for metric in after_metrics )
123+ after = after_info [DEFAULT_METRIC_NAME ]
124+ self .assertEqual (after .filter_ , NEW_FILTER )
125+ self .assertEqual (after .description , NEW_DESCRIPTION )
You can’t perform that action at this time.
0 commit comments