Esempio n. 1
0
 def test_interaction_id_id_must_be_int(self, mock_json_retriever):
     mock_json_retriever.return_value = [
         self.interaction_json, self.interaction_json
     ]
     ligand = Ligand(self.ligand_json)
     with self.assertRaises(TypeError):
         ligand.get_interaction_by_id("1")
Esempio n. 2
0
 def test_can_get_interaction_by_id(self, mock_json_retriever):
     mock_json_retriever.return_value = [
         self.interaction_json, self.interaction_json
     ]
     ligand = Ligand(self.ligand_json)
     interaction = ligand.get_interaction_by_id(
         self.interaction_json["interactionId"])
     self.assertIsInstance(interaction, Interaction)
Esempio n. 3
0
 def test_interaction_id_id_must_be_int(self, mock_json_retriever):
     mock_json_retriever.return_value =[self.interaction_json, self.interaction_json]
     ligand = Ligand(self.ligand_json)
     with self.assertRaises(TypeError):
         ligand.get_interaction_by_id("1")
Esempio n. 4
0
 def test_cannot_get_interaction_by_invalid_id(self, mock_json_retriever):
     mock_json_retriever.return_value = None
     ligand = Ligand(self.ligand_json)
     with self.assertRaises(exceptions.NoSuchInteractionError):
         interaction = ligand.get_interaction_by_id(0)
Esempio n. 5
0
 def test_can_get_interaction_by_id(self, mock_json_retriever):
     mock_json_retriever.return_value = [self.interaction_json, self.interaction_json]
     ligand = Ligand(self.ligand_json)
     interaction = ligand.get_interaction_by_id(self.interaction_json["interactionId"])
     self.assertIsInstance(interaction, Interaction)
Esempio n. 6
0
 def test_cannot_get_interaction_by_invalid_id(self, mock_json_retriever):
     mock_json_retriever.return_value = None
     ligand = Ligand(self.ligand_json)
     with self.assertRaises(exceptions.NoSuchInteractionError):
         interaction = ligand.get_interaction_by_id(0)