Skip to content

Commit

Permalink
implementing txt assertion with csv instead of pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
andresperezlopez committed Sep 14, 2018
1 parent cbee2fc commit d8f7cdd
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/test_core.py
Expand Up @@ -16,7 +16,7 @@
import jams
import pandas as pd
import warnings

import csv

# FIXTURES
# Paths to files for testing
Expand Down Expand Up @@ -1402,16 +1402,14 @@ def test_generate():

# validate txt
txt_file_name = os.path.join(tmp_dir, tmp_name + '.txt')
txt = pd.read_csv(txt_file_name, header=None, sep='\t')
regtxt = pd.read_csv(REG_TXT_PATH, header=None, sep='\t')

print (txt_file_name)
print (REG_TXT_PATH)
with open(txt_file_name, mode='r') as txt:
txtreader = csv.reader(txt, delimiter='\t')

print (txt)
print (regtxt)
with open(REG_TXT_PATH, mode='r') as regtxt:
regtxtreader = csv.reader(regtxt, delimiter='\t')

assert (txt == regtxt).all().all()
for row1, row2 in zip(txtreader, regtxtreader):
assert row1 == row2

# Delete recursively the temp folder
shutil.rmtree(tmp_dir, ignore_errors=True)

0 comments on commit d8f7cdd

Please sign in to comment.