Add two unit tests for tensorboard. (#9561)
It checks the number of scalars should be returned. ``` testScalars() testScalarsCsv() ```
This commit is contained in:
parent
db5d632448
commit
f2bab40647
@ -227,6 +227,17 @@ class TensorboardServerTest(test.TestCase):
|
||||
response.read()
|
||||
connection.close()
|
||||
|
||||
def testScalars(self):
|
||||
"""Test the format of /data/scalars."""
|
||||
data = self._getJson('/data/scalars?run=run1&tag=simple_values')
|
||||
self.assertEqual(len(data),self._SCALAR_COUNT)
|
||||
|
||||
def testScalarsCsv(self):
|
||||
"""Test the csv format of /data/scalars."""
|
||||
data = self._get('/data/scalars?run=run1&tag=simple_values&format=csv').read()
|
||||
line_count = data.count('\n')
|
||||
self.assertEqual(line_count,self._SCALAR_COUNT + 1) # include 1 more line for header
|
||||
|
||||
def testHistograms(self):
|
||||
"""Test the format of /data/histograms."""
|
||||
self.assertEqual(
|
||||
|
Loading…
Reference in New Issue
Block a user