Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ numpy>=1.10
torch>=1.1.0,<=1.10.0
easydict>=1.7,<2
testtools>=2
setuptools<=59.5.0
dm-tree>=0.1.6
tianshou>=0.4.5
jax[cpu]>=0.2.17
52 changes: 26 additions & 26 deletions test/entry/cli/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_simple_export(self):

assert result.exit_code == 0
assert os.path.exists('t1.btv')
assert 150 < os.path.getsize('t1.btv') < 240
assert os.path.getsize('t1.btv') < 240

with open('t1.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t1
Expand All @@ -44,11 +44,11 @@ def test_multiple_export(self):

assert result.exit_code == 0
assert os.path.exists('t1.btv')
assert 150 < os.path.getsize('t1.btv') < 240
assert os.path.getsize('t1.btv') < 240
assert os.path.exists('t2.btv')
assert 200 < os.path.getsize('t2.btv') < 290
assert os.path.getsize('t2.btv') < 290
assert os.path.exists('t3.btv')
assert 210 < os.path.getsize('t3.btv') < 260
assert os.path.getsize('t3.btv') < 260

with open('t1.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t1
Expand All @@ -63,9 +63,9 @@ def test_multiple_export(self):
assert result.exit_code == 0
assert not os.path.exists('t1.btv')
assert os.path.exists('t2.btv')
assert 200 < os.path.getsize('t2.btv') < 290
assert os.path.getsize('t2.btv') < 290
assert os.path.exists('t3.btv')
assert 210 < os.path.getsize('t3.btv') < 260
assert os.path.getsize('t3.btv') < 260

with open('t2.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t2
Expand All @@ -80,11 +80,11 @@ def test_multiple_export_without_compression(self):

assert result.exit_code == 0
assert os.path.exists('t1.btv')
assert 2120 < os.path.getsize('t1.btv') < 2170
assert os.path.getsize('t1.btv') < 2170
assert os.path.exists('t2.btv')
assert 2120 < os.path.getsize('t2.btv') < 2220
assert os.path.getsize('t2.btv') < 2220
assert os.path.exists('t3.btv')
assert 4120 < os.path.getsize('t3.btv') < 4170
assert os.path.getsize('t3.btv') < 4170

with open('t1.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t1
Expand All @@ -100,11 +100,11 @@ def test_multiple_export_without_compression(self):

assert result.exit_code == 0
assert os.path.exists('t1.btv')
assert 2120 < os.path.getsize('t1.btv') < 2170
assert os.path.getsize('t1.btv') < 2170
assert os.path.exists('t2.btv')
assert 2120 < os.path.getsize('t2.btv') < 2230
assert os.path.getsize('t2.btv') < 2230
assert os.path.exists('t3.btv')
assert 4120 < os.path.getsize('t3.btv') < 4170
assert os.path.getsize('t3.btv') < 4170

with open('t1.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t1
Expand All @@ -121,11 +121,11 @@ def test_multiple_export_with_compress_define(self):

assert result.exit_code == 0
assert os.path.exists('t1.btv')
assert 150 < os.path.getsize('t1.btv') < 220
assert os.path.getsize('t1.btv') < 220
assert os.path.exists('t2.btv')
assert 160 < os.path.getsize('t2.btv') < 240
assert os.path.getsize('t2.btv') < 240
assert os.path.exists('t3.btv')
assert 160 < os.path.getsize('t3.btv') < 210
assert os.path.getsize('t3.btv') < 210

with open('t1.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t1
Expand All @@ -142,11 +142,11 @@ def test_multiple_export_with_compress_define(self):

assert result.exit_code == 0
assert os.path.exists('t1.btv')
assert 260 < os.path.getsize('t1.btv') < 330
assert os.path.getsize('t1.btv') < 330
assert os.path.exists('t2.btv')
assert 280 < os.path.getsize('t2.btv') < 430
assert os.path.getsize('t2.btv') < 430
assert os.path.exists('t3.btv')
assert 280 < os.path.getsize('t3.btv') < 375
assert os.path.getsize('t3.btv') < 375

with open('t1.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t1
Expand All @@ -169,9 +169,9 @@ def test_with_od(self):

assert result.exit_code == 0
assert os.path.exists('subpath/t1.btv')
assert 200 < os.path.getsize('subpath/t1.btv') < 290
assert os.path.getsize('subpath/t1.btv') < 290
assert os.path.exists('subpath/t2.btv')
assert 210 < os.path.getsize('subpath/t2.btv') < 260
assert os.path.getsize('subpath/t2.btv') < 260
assert not os.path.exists('subpath/t3.btv')

with open('subpath/t1.btv', 'rb') as file:
Expand All @@ -192,9 +192,9 @@ def test_with_od(self):

assert result.exit_code == 0
assert os.path.exists('subpath/t1.btv')
assert 200 < os.path.getsize('subpath/t1.btv') < 290
assert os.path.getsize('subpath/t1.btv') < 290
assert os.path.exists('subpath/t2.btv')
assert 210 < os.path.getsize('subpath/t2.btv') < 260
assert os.path.getsize('subpath/t2.btv') < 260
assert not os.path.exists('subpath/t3.btv')

with open('subpath/t1.btv', 'rb') as file:
Expand All @@ -213,9 +213,9 @@ def test_with_od(self):
assert result.exit_code == 0
assert not os.path.exists('subpath/t1.btv')
assert os.path.exists('subpath/t2.btv')
assert 200 < os.path.getsize('subpath/t2.btv') < 290
assert os.path.getsize('subpath/t2.btv') < 290
assert os.path.exists('subpath/t3.btv')
assert 210 < os.path.getsize('subpath/t3.btv') < 260
assert os.path.getsize('subpath/t3.btv') < 260

with open('subpath/t2.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t2
Expand All @@ -233,9 +233,9 @@ def test_with_od(self):
assert not os.path.exists('t1.btv')
assert not os.path.exists('t2.btv')
assert os.path.exists('ppp.btv')
assert 200 < os.path.getsize('ppp.btv') < 290
assert os.path.getsize('ppp.btv') < 290
assert os.path.exists('t3.btv')
assert 210 < os.path.getsize('t3.btv') < 260
assert os.path.getsize('t3.btv') < 260

with open('ppp.btv', 'rb') as file:
assert load(file, type_=FastTreeValue) == t2
Expand Down
8 changes: 4 additions & 4 deletions test/tree/tree/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_dumps_and_loads(self):

_dumped_data = dumps(t)
t1 = loads(_dumped_data, type_=FastTreeValue)
assert 2130 < len(_dumped_data) < 2170
assert len(_dumped_data) < 2170
assert isinstance(t1, FastTreeValue)
assert t1 == t

Expand All @@ -36,7 +36,7 @@ def test_dumps_and_loads_with_zip(self):

_dumped_data = dumps(t, compress=zlib)
t1 = loads(_dumped_data, type_=FastTreeValue)
assert 210 < len(dumps(t, compress=zlib)) < 240
assert len(dumps(t, compress=zlib)) < 240
assert isinstance(t1, FastTreeValue)
assert t1 == t

Expand All @@ -55,7 +55,7 @@ def test_dumps_and_loads_with_zip_tuple(self):

_dumped_data = dumps(t, compress=(zlib.compress, zlib.decompress))
t1 = loads(_dumped_data, type_=FastTreeValue)
assert 210 < len(_dumped_data) < 240
assert len(_dumped_data) < 240
assert isinstance(t1, FastTreeValue)
assert t1 == t

Expand All @@ -69,7 +69,7 @@ def test_dumps_and_loads_with_compress_only(self):

_dumped_data = dumps(t, compress=zlib.compress)
t1 = loads(_dumped_data, decompress=zlib.decompress, type_=FastTreeValue)
assert 130 < len(_dumped_data) < 170
assert len(_dumped_data) < 170
assert isinstance(t1, FastTreeValue)
assert t1 == t

Expand Down