add test file for data module
This commit is contained in:
31
tests/test_data.py
Normal file
31
tests/test_data.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Test of data module.
|
||||
|
||||
:Date: 2019-06-12
|
||||
|
||||
.. module:: test_data
|
||||
:platform: *nix, Windows
|
||||
:synopsis: Test of data module.
|
||||
|
||||
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
|
||||
"""
|
||||
import unittest
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../src'))
|
||||
from data import data_read
|
||||
|
||||
|
||||
class TestFit(unittest.TestCase):
|
||||
|
||||
def test_read(self):
|
||||
"""test read function"""
|
||||
file_name = "test_fit.dat"
|
||||
x, y = data_read(file_name, 3, 2)
|
||||
|
||||
self.assertEqual(len(x), 1027)
|
||||
self.assertEqual(len(y), 1027)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user