Add two unit tests for tensorboard. (#9561)

It checks the number of scalars should be returned.
```
testScalars()
testScalarsCsv()
```
This commit is contained in:
Chris Hoyean Song 2017-05-02 04:59:09 +09:00 committed by Vijay Vasudevan
parent db5d632448
commit f2bab40647

View File

@ -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(