示例#1
0
def test_populated_places_table(populated_places_table):
    username, layername = populated_places_table
    print(f"username={username}, layername={layername}")
    col_names = db.get_text_column_names(username, layername)
    assert len(col_names) == 31
    langs = db.get_text_languages(username, layername)
    assert set(langs) == set(['chi', 'eng', 'rus'])
示例#2
0
def test_data_language_roads(road_table):
    username, layername = road_table
    # print(f"username={username}, layername={layername}")
    col_names = db.get_text_column_names(username, layername)
    assert set(col_names) == set([
        'cislouseku',
        'dpr_smer_p',
        'etah1',
        'etah2',
        'etah3',
        'etah4',
        'fid_zbg',
        'jmeno',
        'kruh_obj_k',
        'kruh_obj_p',
        'peazkom1',
        'peazkom2',
        'peazkom3',
        'peazkom4',
        'r_indsil7',
        'silnice',
        'silnice_bs',
        'typsil_k',
        'typsil_p',
        'vym_tahy_k',
        'vym_tahy_p'
    ])
    langs = db.get_text_languages(username, layername)
    assert langs == ['cze']
示例#3
0
def test_data_language_countries(country_table):
    workspace, layername = country_table
    # print(f"username={username}, layername={layername}")
    with layman.app_context():
        col_names = db.get_text_column_names(workspace, layername)
    assert len(col_names) == 63
    with layman.app_context():
        langs = db.get_text_languages(workspace, layername)
    assert set(langs) == set([
        'ara',
        'ben',
        'chi',
        'eng',
        'fre',
        'gre',
        'hin',
        'hun',
        'jpn',
        'kor',
        'pol',
        'por',
        'rus',
        'tur',
        'vie',
    ])
示例#4
0
def test_populated_places_table(populated_places_table):
    workspace, layername = populated_places_table
    print(f"workspace={workspace}, layername={layername}")
    with layman.app_context():
        col_names = db.get_text_column_names(workspace, layername)
    assert len(col_names) == 31
    with layman.app_context():
        langs = db.get_text_languages(workspace, layername)
    assert set(langs) == set(['chi', 'eng', 'rus'])
示例#5
0
def test_data_language(boundary_table):
    username, layername = boundary_table
    # print(f"username={username}, layername={layername}")
    col_names = db.get_text_column_names(username, layername)
    assert set(col_names) == set(['featurecla', 'name', 'name_alt'])
    text_data, _ = db.get_text_data(username, layername)
    # print(f"num_rows={num_rows}")
    assert len(text_data) == 1
    assert text_data[0].startswith(' '.join(['International boundary (verify)'] * 100))
    langs = db.get_text_languages(username, layername)
    assert langs == ['eng']
示例#6
0
def test_data_language_countries(country_table):
    username, layername = country_table
    # print(f"username={username}, layername={layername}")
    col_names = db.get_text_column_names(username, layername)
    assert len(col_names) == 63
    langs = db.get_text_languages(username, layername)
    assert set(langs) == set([
        'ara',
        'ben',
        'chi',
        'dut',
        'eng',
        'fre',
        'ger',
        'gre',
        'hin',
        'hun',
        'jpn',
        'kor',
        'pol',
        'rus',
        'spa',
        'vie',
    ])