Ejemplo n.º 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'])))
Ejemplo n.º 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'))
        )))
Ejemplo n.º 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'])))
Ejemplo n.º 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'])))
Ejemplo n.º 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'])))
Ejemplo n.º 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')))))
Ejemplo n.º 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')))
Ejemplo n.º 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')))