예제 #1
0
    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")
예제 #2
0
    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")
예제 #3
0
    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")
예제 #4
0
    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")
예제 #5
0
    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(), [])
예제 #6
0
    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(), [])