def test_can_get_interactions(self, mock_json_retriever): mock_json_retriever.return_value = [self.interaction_json, self.interaction_json] target = Target(self.target_json) interactions = target.interactions() self.assertIsInstance(interactions, list) self.assertEqual(len(interactions), 2) for interaction in interactions: self.assertIsInstance(interaction, Interaction)
def test_can_get_interactions(self, mock_json_retriever): mock_json_retriever.return_value = [ self.interaction_json, self.interaction_json ] target = Target(self.target_json) interactions = target.interactions() self.assertIsInstance(interactions, list) self.assertEqual(len(interactions), 2) for interaction in interactions: self.assertIsInstance(interaction, Interaction)
def test_interactions_when_no_json(self, mock_json_retriever): mock_json_retriever.return_value = None target = Target(self.target_json) self.assertEqual(target.interactions(), [])