Skip to content

Commit

Permalink
fix: fix test_index and test_container
Browse files Browse the repository at this point in the history
  • Loading branch information
nan-wang committed Jul 12, 2020
1 parent 5a8b865 commit a68e2be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ def test_container_volume(self):
with f:
f.index(input_fn=random_docs(10))

out_file = os.path.join(cur_dir, 'abc/ext-mwu-encoder.bin')
# out_file = os.path.join(cur_dir, 'abc/ext-mwu-encoder.bin')
out_file = 'abc/ext-mwu-encoder.bin'
self.assertTrue(os.path.exists(out_file))
self.add_tmpfile(out_file, os.path.join(cur_dir, './abc'))
# self.add_tmpfile(out_file, os.path.join(cur_dir, './abc'))
self.add_tmpfile(out_file, './abc')

def test_container_ping(self):
a4 = set_pea_parser().parse_args(['--image', img_name])
Expand Down
17 changes: 10 additions & 7 deletions tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,16 @@ def test_index(self):
f.index(input_fn=random_docs(1000))

for j in range(3):
self.assertTrue(os.path.exists(
os.path.join(cur_dir, f'test2-{j + 1}/test2.bin')))
self.assertTrue(os.path.exists(
os.path.join(cur_dir, f'test2-{j + 1}/tmp2')))
self.add_tmpfile(
os.path.join(cur_dir, f'test2-{j + 1}/test2.bin'),
os.path.join(cur_dir, f'test2-{j + 1}/tmp2', f'test2-{j + 1}'))
self.assertTrue(os.path.exists(f'test2-{j + 1}/test2.bin'))
self.assertTrue(os.path.exists(f'test2-{j + 1}/tmp2'))
self.add_tmpfile(f'test2-{j + 1}/test2.bin', f'test2-{j + 1}/tmp2', f'test2-{j + 1}')
# self.assertTrue(os.path.exists(
# os.path.join(cur_dir, f'test2-{j + 1}/test2.bin')))
# self.assertTrue(os.path.exists(
# os.path.join(cur_dir, f'test2-{j + 1}/tmp2')))
# self.add_tmpfile(
# os.path.join(cur_dir, f'test2-{j + 1}/test2.bin'),
# os.path.join(cur_dir, f'test2-{j + 1}/tmp2', f'test2-{j + 1}'))

time.sleep(3)
with f:
Expand Down

0 comments on commit a68e2be

Please sign in to comment.