Exemple #1
0
    def test_get_table_pathing_1(self, ShortestPath):
        ShortestPath.return_value = self.table_path_1

        for index in range(len(self.table_names_1)):
            with self.subTest(table_index=index):
                querying.get_table_pathing(self.graph, self.table_list_1)

                ShortestPath.assert_any_call(self.graph, "center",
                                             self.table_names_1[index])

                ShortestPath.clear()
Exemple #2
0
    def test_get_table_pathing_1(self, shortest_path_mock):
        """Verify shortest_path() is called with correct parameters.
        """
        shortest_path_mock.return_value = self.table_path_1

        for index in range(len(self.table_names_1)):
            with self.subTest(table_index=index):
                querying.get_table_pathing(self.graph, self.table_list_1)

                shortest_path_mock.assert_any_call(self.graph, "center",
                                                   self.table_names_1[index])

                shortest_path_mock.clear()
Exemple #3
0
    def test_get_table_pathing_2(self, shortest_path_mock):
        """Verify center_table parameter influences shortest_path() parameters.
        """
        shortest_path_mock.return_value = self.table_path_1

        for index in range(len(self.table_names_2)):
            with self.subTest(table_index=index):
                querying.get_table_pathing(self.graph,
                                           self.table_list_2,
                                           center_table=self.center)

                shortest_path_mock.assert_any_call(self.graph, "center",
                                                   self.table_names_2[index])

                shortest_path_mock.clear()
Exemple #4
0
    def test_get_table_pathing_2(self):
        """Verify get_table_pathing() builds from distal center table.
        """
        table_list = [self.gene, self.phage, self.trna]

        table_pathing = querying.get_table_pathing(self.graph, table_list)

        self.assertEqual(table_pathing[0], self.gene)
        self.assertEqual(table_pathing[1][0], ["gene", "phage"])
        self.assertEqual(table_pathing[1][1], ["gene", "phage", "trna"])
Exemple #5
0
    def test_get_table_pathing_3(self):
        """Verify get_table_pathing() correctly utilizes center_table input.
        """
        table_list = [self.gene, self.phage, self.trna]

        table_pathing = querying.get_table_pathing(self.graph,
                                                   table_list,
                                                   center_table=self.phage)

        self.assertEqual(table_pathing[0], self.phage)
        self.assertEqual(table_pathing[1][0], ["phage", "gene"])
        self.assertEqual(table_pathing[1][1], ["phage", "trna"])