Simple function for reading in .mpt text files

This will be helpful for checking the data read in by the .mpr
file reader
This commit is contained in:
Chris Kerr
2013-11-29 22:19:01 +00:00
parent 98dc2800d7
commit 9e66d589a4
4 changed files with 72 additions and 0 deletions

23
tests/test_BioLogic.py Normal file
View File

@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
import os.path
from nose.tools import ok_, eq_, raises
from .. import MPTfile
testdata_dir = os.path.join(os.path.dirname(__file__), 'testdata')
def test_open_MPT():
mpt1, comments = MPTfile(os.path.join(testdata_dir, 'bio-logic1.mpt'))
eq_(comments, [])
eq_(mpt1.fieldnames, ["mode", "ox/red", "error", "control changes",
"Ns changes", "counter inc.", "time/s",
"control/V/mA", "Ewe/V", "dq/mA.h", "P/W",
"<I>/mA", "(Q-Qo)/mA.h", "x"])
@raises(ValueError)
def test_open_MPT_fails_for_bad_file():
mpt1 = MPTfile(os.path.join(testdata_dir, 'bio-logic1.mpr'))