@@ -91,7 +91,13 @@ def test_repr(self):
9191
9292class ScalarTimeSeriesTest (tb_test .TestCase ):
9393 def _scalar_time_series (
94- self , max_step , max_wall_time , plugin_content , description , display_name
94+ self ,
95+ max_step ,
96+ max_wall_time ,
97+ plugin_content ,
98+ description ,
99+ display_name ,
100+ last_value ,
95101 ):
96102 # Helper to use explicit kwargs.
97103 return provider .ScalarTimeSeries (
@@ -100,6 +106,7 @@ def _scalar_time_series(
100106 plugin_content = plugin_content ,
101107 description = description ,
102108 display_name = display_name ,
109+ last_value = last_value ,
103110 )
104111
105112 def test_repr (self ):
@@ -109,26 +116,28 @@ def test_repr(self):
109116 plugin_content = b"AB\xCD \xEF !\x00 " ,
110117 description = "test test" ,
111118 display_name = "one two" ,
119+ last_value = 0.0001 ,
112120 )
113121 repr_ = repr (x )
114122 self .assertIn (repr (x .max_step ), repr_ )
115123 self .assertIn (repr (x .max_wall_time ), repr_ )
116124 self .assertIn (repr (x .plugin_content ), repr_ )
117125 self .assertIn (repr (x .description ), repr_ )
118126 self .assertIn (repr (x .display_name ), repr_ )
127+ self .assertIn (repr (x .last_value ), repr_ )
119128
120129 def test_eq (self ):
121- x1 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" )
122- x2 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" )
123- x3 = self ._scalar_time_series (66 , 4321.0 , b"\x7F " , "hmm" , "hum" )
130+ x1 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" , 512 )
131+ x2 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" , 512 )
132+ x3 = self ._scalar_time_series (66 , 4321.0 , b"\x7F " , "hmm" , "hum" , 1024 )
124133 self .assertEqual (x1 , x2 )
125134 self .assertNotEqual (x1 , x3 )
126135 self .assertNotEqual (x1 , object ())
127136
128137 def test_hash (self ):
129- x1 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" )
130- x2 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" )
131- x3 = self ._scalar_time_series (66 , 4321.0 , b"\x7F " , "hmm" , "hum" )
138+ x1 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" , 512 )
139+ x2 = self ._scalar_time_series (77 , 1234.5 , b"\x12 " , "one" , "two" , 512 )
140+ x3 = self ._scalar_time_series (66 , 4321.0 , b"\x7F " , "hmm" , "hum" , 1024 )
132141 self .assertEqual (hash (x1 ), hash (x2 ))
133142 # The next check is technically not required by the `__hash__`
134143 # contract, but _should_ pass; failure on this assertion would at
0 commit comments