Skip to content

Commit 6bf2c99

Browse files
committed
test bug fixed
1 parent 375ccd7 commit 6bf2c99

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

functional_tests/func_test_json_to_mmcif.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import sys
1414
import tempfile
1515
import json
16+
import shutil
1617
from unittest.mock import patch
1718

1819
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
@@ -46,7 +47,7 @@ def tearDown(self):
4647
os.remove(self.mmcif_file)
4748
if os.path.exists(self.cif_file):
4849
os.remove(self.cif_file)
49-
os.rmdir(self.temp_dir)
50+
shutil.rmtree(self.temp_dir)
5051

5152
@patch('urllib.request.urlretrieve')
5253
def test_json_conversion(self, mock_urlretrieve):

unit_test/test_mmcif_validator.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ def test_mmcif_validation_failure(self, mock_isfile, mock_run):
6969
result = mmcif_validation(self.cif_file, 'no', self.output_file)
7070
self.assertFalse(result)
7171

72-
@patch('urllib.request.urlretrieve')
73-
def test_mmcif_validation_missing_dict(self, mock_urlretrieve):
74-
mock_urlretrieve.return_value = ('', '')
75-
# Simulate missing dictionary file
76-
dic_file = os.path.join(self.mmcif_tools_path, 'mmcif_pdbx_v50.dic')
77-
result = mmcif_validation(self.cif_file, 'no', self.output_file)
78-
self.assertFalse(result[0])
79-
self.assertIn("Dictionary file", result[1])
80-
8172
@patch('subprocess.run')
8273
@patch('os.path.isfile', side_effect=lambda x: True if 'mmcif_pdbx_v50.dic' in x or 'test.cif' in x else False)
8374
def test_unexpected_exception(self, mock_isfile, mock_run):

0 commit comments

Comments
 (0)