コード例 #1
0
    def test_it_should_sanitize_search_terms(self):
        """Removes street terms from search terms"""
        filter = query(index('address'), search('Plaza Santa Ana'))

        result = self.filter(filter, (AVAILABLE_STATION, NO_BIKES_STATION))

        assert_that(result, contains(
            has_property('idestacion', AVAILABLE_STATION['idestacion'])))
コード例 #2
0
    def test_it_should_create_an_index_using_station_data(self):
        result = self.filter(index('nombre', 'address'),
                            (NAME_AND_ADDRESS_STATION,))

        assert_that(result, contains(has_property('index', all_of(
            contains_string('matadero'),
            contains_string('chopera'))
        )))
コード例 #3
0
    def test_it_should_search_by_field(self):
        """Searches by given field"""
        filter = query(index('address'), search('Plaza Santa Ana'))

        result = self.filter(filter, (AVAILABLE_STATION, NO_BIKES_STATION))

        assert_that(result, contains(
            has_property('idestacion', AVAILABLE_STATION['idestacion'])))
コード例 #4
0
    def test_it_should_sanitize_search_terms(self):
        """Removes street terms from search terms"""
        filter = query(index('address'), search('Plaza Santa Ana'))

        result = self.filter(filter, (AVAILABLE_STATION, NO_BIKES_STATION))

        assert_that(
            result,
            contains(
                has_property('idestacion', AVAILABLE_STATION['idestacion'])))
コード例 #5
0
    def test_it_should_search_by_field(self):
        """Searches by given field"""
        filter = query(index('address'), search('Plaza Santa Ana'))

        result = self.filter(filter, (AVAILABLE_STATION, NO_BIKES_STATION))

        assert_that(
            result,
            contains(
                has_property('idestacion', AVAILABLE_STATION['idestacion'])))
コード例 #6
0
    def test_it_should_create_an_index_using_station_data(self):
        result = self.filter(index('nombre', 'address'),
                             (NAME_AND_ADDRESS_STATION, ))

        assert_that(
            result,
            contains(
                has_property(
                    'index',
                    all_of(contains_string('matadero'),
                           contains_string('chopera')))))
コード例 #7
0
    def test_it_should_create_a_index_property(self):
        result = self.filter(index('nombre', 'address'),
                            (FIRST_STATION, AVAILABLE_STATION))

        assert_that(result, only_contains(has_property('index')))
コード例 #8
0
    def test_it_should_create_a_index_property(self):
        result = self.filter(index('nombre', 'address'),
                             (FIRST_STATION, AVAILABLE_STATION))

        assert_that(result, only_contains(has_property('index')))