xautodl/tests/test_synthetic_env.py

21 lines
706 B
Python
Raw Normal View History

2021-04-22 17:08:43 +02:00
#####################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.04 #
#####################################################
# pytest tests/test_synthetic_env.py -s #
#####################################################
import unittest
2021-05-27 19:41:32 +02:00
from xautodl.datasets.synthetic_core import get_synthetic_env
2021-04-22 17:08:43 +02:00
class TestSynethicEnv(unittest.TestCase):
"""Test the synethtic environment."""
def test_simple(self):
2021-05-27 19:41:32 +02:00
versions = ["v1", "v2", "v3", "v4"]
for version in versions:
env = get_synthetic_env(version=version)
print(env)
2021-05-27 20:22:59 +02:00
for timestamp, (x, y) in env:
self.assertEqual(x.shape, (1000, env.ndim))