imikolov_test.py 457 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import paddle.v2.dataset.imikolov
import unittest


class TestMikolov(unittest.TestCase):
    def check_reader(self, reader, n):
        for l in reader():
            self.assertEqual(len(l), n)

    def test_train(self):
        n = 5
        self.check_reader(paddle.v2.dataset.imikolov.train(n), n)

    def test_test(self):
        n = 5
        self.check_reader(paddle.v2.dataset.imikolov.test(n), n)


if __name__ == '__main__':
    unittest.main()