Refactoring
This commit is contained in:
parent
33b484085f
commit
e612b52087
2 changed files with 6 additions and 6 deletions
|
@ -18,7 +18,7 @@ License.
|
|||
import json
|
||||
from unittest import TestCase
|
||||
|
||||
from validator.residue_index import CheckResidueIndices
|
||||
from validator.residue_index import ResidueIndexes
|
||||
|
||||
with open("data/test_data.json", "r") as mock_data_file:
|
||||
mock_data = json.load(mock_data_file)
|
||||
|
@ -46,7 +46,7 @@ def mock_compare_residue_number(self, foo, bar):
|
|||
class TestCheckResidueIndices(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.cri = CheckResidueIndices(mock_data)
|
||||
self.cri = ResidueIndexes(mock_data)
|
||||
|
||||
def test_loop_chains(self):
|
||||
self.cri._get_residue_numbering = mock_get_residue_numbering_false
|
||||
|
@ -60,7 +60,7 @@ class TestCheckResidueIndices(TestCase):
|
|||
|
||||
def test_set_pdb_id(self):
|
||||
self.assertIsNotNone(self.cri._set_pdb_id())
|
||||
bad_cri = CheckResidueIndices(mock_data_no_pdb_id)
|
||||
bad_cri = ResidueIndexes(mock_data_no_pdb_id)
|
||||
self.assertIsNone(bad_cri._set_pdb_id())
|
||||
|
||||
def test_check_numbering(self):
|
||||
|
@ -85,7 +85,7 @@ class TestCheckResidueIndices(TestCase):
|
|||
self.assertFalse(result)
|
||||
|
||||
def test_with_bad_numbering(self):
|
||||
cri_with_bad_numbering = CheckResidueIndices(mock_data_bad_numbering)
|
||||
cri_with_bad_numbering = ResidueIndexes(mock_data_bad_numbering)
|
||||
result = cri_with_bad_numbering.check_every_residue()
|
||||
self.assertFalse(result)
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import json
|
|||
import requests
|
||||
|
||||
|
||||
class CheckResidueIndices(object):
|
||||
class ResidueIndexes(object):
|
||||
"""
|
||||
This class has all the methods required for validating the
|
||||
residue indices that are in the user submitted data.
|
||||
|
@ -29,7 +29,7 @@ class CheckResidueIndices(object):
|
|||
indices
|
||||
|
||||
Example usage:
|
||||
check_indexes = CheckResidueIndices(your_json_object)
|
||||
check_indexes = ResidueIndexes(your_json_object)
|
||||
if check_indexes.check_every_residue():
|
||||
# all residues in every chain are correctly indexed
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue