# -*- coding: utf-8 -*- """Test of data_step_std module. :Date: 2020-01-03 .. module:: test_data_step_std :platform: *nix, Windows :synopsis: Test of data_step_std module. .. moduleauthor:: Daniel Weschke """ import unittest import os import sys from pylib.data_step_std import ( BOOLEAN, CARTESIAN_POINT, VERTEX_POINT, ) sys.path.insert(0, os.path.abspath('..')) class TestDataStepStd(unittest.TestCase): def test_BOOLEAN(self): self.assertRaises( TypeError, BOOLEAN, ) self.assertRaises( ValueError, BOOLEAN, '', ) self.assertEqual( BOOLEAN('.T.'), True, ) self.assertEqual( BOOLEAN('.F.'), False, ) #def test_ def test_multi_objects(self): cp = CARTESIAN_POINT('', (0.E+000, 0.E+000, 0.E+000)) #print(cp) self.assertEqual( str(cp), "#1 = CARTESIAN_POINT('', (0.0, 0.0, 0.0))") cp2 = eval('CARTESIAN_POINT("j", (0.E+000,0.E+000,0.E+000))') #print(cp2) self.assertEqual( str(cp2), "#2 = CARTESIAN_POINT('j', (0.0, 0.0, 0.0))") vp = VERTEX_POINT('', cp) #print(vp) self.assertEqual( str(vp), "#3 = VERTEX_POINT('', #1)") if __name__ == '__main__': unittest.main(verbosity=2)