-def test_process_amenity_with_operator(special_phrases_importer, getorcreate_amenityoperator_funcs,
- word_table, temp_db_conn):
- """
- Test that _process_amenity() execute well the
- getorcreate_amenityoperator() SQL function and that
- the 2 differents operators are well handled.
- """
- special_phrases_importer._process_amenity('', '', '', '', 'near')
- special_phrases_importer._process_amenity('', '', '', '', 'in')
-
- with temp_db_conn.cursor() as temp_db_cursor:
- temp_db_cursor.execute("SELECT * FROM temp_with_operator WHERE op='near' OR op='in'")
- results = temp_db_cursor.fetchall()
-
- assert len(results) == 2
-
-def test_process_amenity_without_operator(special_phrases_importer, getorcreate_amenity_funcs,
- temp_db_conn):
- """
- Test that _process_amenity() execute well the
- getorcreate_amenity() SQL function.
- """
- special_phrases_importer._process_amenity('', '', '', '', '')
-
- with temp_db_conn.cursor() as temp_db_cursor:
- temp_db_cursor.execute("SELECT * FROM temp_without_operator WHERE op='no_operator'")
- result = temp_db_cursor.fetchone()
-
- assert result
-