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'])))
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')) )))
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'])))
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'])))
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'])))
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')))))
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')))