Exemple #1
0
    def test_search_by_distance_check_limit(self):
        """
        Test to validate that solr searches by distance using several units. It will also validate
        that and exception is arisen if geodetic predicates are used against cartesian geometry

        @since 2.0.0
        @jira_ticket PYTHON-698
        @expected_result if the search distance is below the real distance only one
        name will be in the list, otherwise, two

        @test_category dse graph
        """
        # Paul Thomas Joe and George Bill Steve are 64.6923761881464 km apart
        self._assert_in_distance(
            Geo.inside(Distance(-92.46295, 44.0234, 65), GeoUnit.KILOMETERS),
            ["George Bill Steve", "Paul Thomas Joe"])

        self._assert_in_distance(
            Geo.inside(Distance(-92.46295, 44.0234, 64), GeoUnit.KILOMETERS),
            ["Paul Thomas Joe"])

        # Paul Thomas Joe and George Bill Steve are 40.19797892069464 miles apart
        self._assert_in_distance(
            Geo.inside(Distance(-92.46295, 44.0234, 41), GeoUnit.MILES),
            ["George Bill Steve", "Paul Thomas Joe"])

        self._assert_in_distance(
            Geo.inside(Distance(-92.46295, 44.0234, 40), GeoUnit.MILES),
            ["Paul Thomas Joe"])
Exemple #2
0
    def test_search_by_distance(self):
        """
        Test to validate that solr searches by distance.

        @since 1.0.0
        @jira_ticket PYTHON-660
        @expected_result all names with a geo location within a 2 degree distance of -92,44 are returned

        @test_category dse graph
        """
        self._assert_in_distance(Geo.inside(Distance(-92, 44, 2)),
                                 ["Paul Thomas Joe", "George Bill Steve"])
Exemple #3
0
    def test_search_by_distance_with_miles_units(self):
        """
        Test to validate that solr searches by distance.

        @since 2.0.0
        @jira_ticket PYTHON-698
        @expected_result all names with a geo location within a 70-mile radius of -92,44 are returned

        @test_category dse graph
        """
        self._assert_in_distance(
            Geo.inside(Distance(-92, 44, 70), GeoUnit.MILES),
            ["Paul Thomas Joe", "George Bill Steve"])
Exemple #4
0
    def _test_search_by_distance_meters_units(self, schema, graphson):
        """
        Test to validate that solr searches by distance.

        @since 2.0.0
        @jira_ticket PYTHON-698
        @expected_result all names with a geo location within a 56k-meter radius of -92,44 are returned

        @test_category dse graph
        """
        self._assert_in_distance(schema, graphson,
            Geo.inside(Distance(-92, 44, 56000), GeoUnit.METERS),
            ["Paul Thomas Joe"]
        )