提交 c65bf61b 编写于 作者: S superjom

fix test

上级 66a17d70
...@@ -7,15 +7,16 @@ import time ...@@ -7,15 +7,16 @@ import time
class StorageTest(unittest.TestCase): class StorageTest(unittest.TestCase):
def setUp(self): def setUp(self):
self.dir = "./tmp/storage_test" self.dir = "./tmp/storage_test"
self.writer = storage.StorageWriter(self.dir, sync_cycle=1).as_mode("train")
def test_write(self): def test_read(self):
print 'test write'
self.writer = storage.StorageWriter(self.dir, sync_cycle=1).as_mode("train")
scalar = self.writer.scalar("model/scalar/min") scalar = self.writer.scalar("model/scalar/min")
scalar.set_caption("model/scalar/min") # scalar.set_caption("model/scalar/min")
for i in range(10): for i in range(10):
scalar.add_record(i, 1.0) scalar.add_record(i, 1.0)
def test_read(self): print 'test read'
self.reader = storage.StorageReader("train", self.dir) self.reader = storage.StorageReader("train", self.dir)
scalar = self.reader.scalar("model/scalar/min") scalar = self.reader.scalar("model/scalar/min")
self.assertEqual(scalar.caption(), "train") self.assertEqual(scalar.caption(), "train")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册