Mercurial > hg > tvii
view tests/test_read.py @ 84:0f3af15bb29a
add noise introduction function
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 17 Dec 2017 13:55:35 -0800 |
parents | e21021ca3907 |
children |
line wrap: on
line source
#!/usr/bin/env python """ we need a simple data reader; let's test it! """ # See also and to combine with: # http://k0s.org/hg/numerics/file/tip/numerics/read.py import os import unittest from tvii.read import read here = os.path.dirname(os.path.abspath(__file__)) data = os.path.join(here, 'data') class TestReadData(unittest.TestCase): def test_csv_vs_tsv(self): """really, not tsv; its actually space separated""" csv_file = os.path.join(data, 'linear.csv') csv_array = read(csv_file) tsv_file = os.path.join(data, 'linear.tsv') tsv_array = read(tsv_file) assert tsv_array == csv_array if __name__ == '__main__': main()