Beispiel #1
0
    def test_get_source_to_target_input(self):
        # initialise QueryCOHD object
        queryCOHD = QueryCOHD()

        # invalid parameter type
        result = queryCOHD.get_source_to_target('312327', 313217)
        self.assertEqual(result, [])

        # invalid parameter type
        result = queryCOHD.get_source_to_target(312327, '313217')
        self.assertEqual(result, [])
Beispiel #2
0
    def test_get_source_to_target_has_result(self):
        # initialise QueryCOHD object
        queryCOHD = QueryCOHD()

        # check if correct result is returned
        result = queryCOHD.get_source_to_target(312327, 313217)
        self.assertIsNotNone(result)
Beispiel #3
0
    def test_get_source_to_target_result(self):
        # initialise QueryCOHD object
        queryCOHD = QueryCOHD()
        # load test data
        with open("./tests/NewQueryCOHDTestsData.json") as file:
            test_data = json.load(file)

        # check if correct result is returned
        result = queryCOHD.get_source_to_target(312327, 313217)
        self.assertListEqual(result, test_data)