From 2503ee1f6414a1d55a2c18909b951668026f9c59 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Wed, 12 Jun 2019 15:52:50 +0200 Subject: [PATCH] add test file for data module --- tests/test_data.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/test_data.py diff --git a/tests/test_data.py b/tests/test_data.py new file mode 100644 index 0000000..6b4d838 --- /dev/null +++ b/tests/test_data.py @@ -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 +""" +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()