Skip to content

Commit f2bab40

Browse files
chris-chrisVijay Vasudevan
authored and
Vijay Vasudevan
committed
Add two unit tests for tensorboard. (tensorflow#9561)
It checks the number of scalars should be returned. ``` testScalars() testScalarsCsv() ```
1 parent db5d632 commit f2bab40

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tensorflow/tensorboard/backend/application_test.py

+11
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,17 @@ def testDataPaths_disableAllCaching(self):
227227
response.read()
228228
connection.close()
229229

230+
def testScalars(self):
231+
"""Test the format of /data/scalars."""
232+
data = self._getJson('/data/scalars?run=run1&tag=simple_values')
233+
self.assertEqual(len(data),self._SCALAR_COUNT)
234+
235+
def testScalarsCsv(self):
236+
"""Test the csv format of /data/scalars."""
237+
data = self._get('/data/scalars?run=run1&tag=simple_values&format=csv').read()
238+
line_count = data.count('\n')
239+
self.assertEqual(line_count,self._SCALAR_COUNT + 1) # include 1 more line for header
240+
230241
def testHistograms(self):
231242
"""Test the format of /data/histograms."""
232243
self.assertEqual(

0 commit comments

Comments
 (0)