Coverage for biobb_vs/test/unitests/test_gnina/test_gnina_run.py: 56%

27 statements  

« prev     ^ index     » next       coverage.py v7.15.3, created at 2026-08-03 13:34 +0000

1# type: ignore 

2import shutil 

3 

4import pytest 

5from biobb_common.tools import test_fixtures as fx 

6 

7from biobb_vs.gnina.gnina_run import gnina_run 

8 

9# gnina is not distributed with this package and is not installable from conda, 

10# so the docking tests only run where the binary is actually available 

11gnina_required = pytest.mark.skipif(shutil.which('gnina') is None, 

12 reason="gnina binary not found in PATH") 

13 

14 

15@gnina_required 

16class TestGninaRun(): 

17 def setup_class(self): 

18 fx.test_setup(self, 'gnina_run') 

19 

20 def teardown_class(self): 

21 fx.test_teardown(self) 

22 pass 

23 

24 def test_gnina_run(self): 

25 # docking is stochastic, so the outputs are only checked for existence 

26 assert fx.exe_success(gnina_run(properties=self.properties, **self.paths)) 

27 assert fx.not_empty(self.paths['output_sdf_path']) 

28 assert fx.not_empty(self.paths['output_summary_path']) 

29 assert fx.not_empty(self.paths['output_log_path']) 

30 

31 

32@gnina_required 

33class TestGninaRunBox(): 

34 def setup_class(self): 

35 fx.test_setup(self, 'gnina_run_box') 

36 

37 def teardown_class(self): 

38 fx.test_teardown(self) 

39 pass 

40 

41 def test_gnina_run_box(self): 

42 # same block driven from a box file instead of an autobox reference, 

43 # and with the optional outputs left out 

44 assert fx.exe_success(gnina_run(properties=self.properties, **self.paths)) 

45 assert fx.not_empty(self.paths['output_sdf_path'])