def test_database_properties(self, mock_json_retriever): mock_json_retriever.return_value = self.database_json target = Target(self.target_json) self.assertEqual(len(target.database_links()), 2) self.assertIsInstance(target.database_links()[0], DatabaseLink) self.assertIsInstance(target.database_links()[1], DatabaseLink) self.assertEqual(target.database_links()[0].accession(), "10576") self.assertEqual(target.database_links()[1].accession(), "11863") self.assertEqual(target.database_links()[0].species(), "Rat") self.assertEqual(target.database_links()[1].species(), "Mouse")
def test_species_database_properties(self, mock_json_retriever): mock_json_retriever.return_value = self.database_json target = Target(self.target_json) links = target.database_links(species="mouse") self.assertEqual(len(links), 1) self.assertIsInstance(links[0], DatabaseLink) self.assertEqual(links[0].accession(), "11863") self.assertEqual(links[0].species(), "Mouse")
def test_database_properties_when_no_json(self, mock_json_retriever): mock_json_retriever.return_value = None target = Target(self.target_json) self.assertEqual(target.database_links(), [])