Coverage for biobb_dna/test/unitests/test_stiffness/test_stiffness.py: 93%

30 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-07 09:06 +0000

1from biobb_common.tools import test_fixtures as fx 

2from biobb_dna.stiffness.average_stiffness import average_stiffness 

3from biobb_dna.stiffness.basepair_stiffness import basepair_stiffness 

4import platform 

5 

6 

7class TestAvgStiffness(): 

8 def setup_class(self): 

9 fx.test_setup(self, 'average_stiffness') 

10 

11 def teardown_class(self): 

12 fx.test_teardown(self) 

13 

14 def test_averagestiffness(self): 

15 returncode = average_stiffness( 

16 properties=self.properties, **self.paths) 

17 assert fx.not_empty(self.paths['output_csv_path']) 

18 assert fx.not_empty(self.paths['output_jpg_path']) 

19 assert fx.exe_success(returncode) 

20 if platform.system() == 'Darwin': 

21 assert fx.equal(self.paths['output_csv_path'], self.paths['ref_csv_output']) 

22 assert fx.equal(self.paths['output_jpg_path'], self.paths['ref_jpg_output']) 

23 

24 

25class TestBasePairStiffness(): 

26 def setup_class(self): 

27 fx.test_setup(self, 'basepair_stiffness') 

28 

29 def teardown_class(self): 

30 fx.test_teardown(self) 

31 

32 def test_basepairstiffness(self): 

33 returncode = basepair_stiffness( 

34 properties=self.properties, **self.paths) 

35 assert fx.not_empty(self.paths['output_csv_path']) 

36 assert fx.not_empty(self.paths['output_jpg_path']) 

37 assert fx.exe_success(returncode) 

38 if platform.system() == 'Darwin': 

39 assert fx.equal(self.paths['output_csv_path'], self.paths['ref_csv_output']) 

40 assert fx.equal(self.paths['output_jpg_path'], self.paths['ref_jpg_output'])