- assert not check_table_exist(temp_db_conn, 'wrong_class', 'wrong_type')
-
- #Format (query, should_return_something_bool) use to easily execute all asserts
- queries_tests = set()
-
- #Used to check that correct place_classtype table already in the datase before is still there.
- query_existing_table = """
- SELECT table_name
- FROM information_schema.tables
- WHERE table_schema='public'
- AND table_name = 'place_classtype_amenity_animal_shelter';
- """
- queries_tests.add((query_existing_table, True))
-
- #Used to check that wrong place_classtype table was deleted from the database.
- query_wrong_table = """
- SELECT table_name
- FROM information_schema.tables
- WHERE table_schema='public'
- AND table_name = 'place_classtype_wrongclass_wrongtype';
- """
- queries_tests.add((query_wrong_table, False))
-
- with temp_db_conn.cursor() as temp_db_cursor:
- for query in queries_tests:
- temp_db_cursor.execute(query[0])
- if (query[1] == True):
- assert temp_db_cursor.fetchone()
- else:
- assert not temp_db_cursor.fetchone()
-
-def mock_get_wiki_content(lang):
- """
- Mock the _get_wiki_content() method to return
- static xml test file content.
- """
- return get_test_xml_wiki_content()