Esempio n. 1
0
def test_misc_types():
    assert dealias_type('begin group') == 'begin_group'
    assert dealias_type('end group') == 'end_group'
    assert dealias_type('begin repeat') == 'begin_repeat'
    assert dealias_type('end repeat') == 'end_repeat'
    assert dealias_type('begin_group') == 'begin_group'
    assert dealias_type('end_group') == 'end_group'
    assert dealias_type('begin_repeat') == 'begin_repeat'
    assert dealias_type('end_repeat') == 'end_repeat'
    assert dealias_type('imei') == 'deviceid'
    assert dealias_type('gps') == 'geopoint'
Esempio n. 2
0
def test_select_multiple_aliases_replaced():
    assert dealias_type('select all that apply from x') == 'select_multiple x'
    assert dealias_type('select all that apply dogs') == 'select_multiple dogs'
    assert dealias_type('select many dogs') == 'select_multiple dogs'
    assert dealias_type('select multiple dogs') == 'select_multiple dogs'
    assert dealias_type('select_many dogs') == 'select_multiple dogs'
    assert dealias_type('select_multiple dogs') == 'select_multiple dogs'
Esempio n. 3
0
def test_select_one_external_replaced():
    assert dealias_type('select one external x') == 'select_one_external x'
Esempio n. 4
0
def _fail_type(_type):
    with pytest.raises(ValueError) as e:
        dealias_type(_type, strict=True)
Esempio n. 5
0
def test_select_one_aliases_replaced():
    assert dealias_type('select1 dogs') == 'select_one dogs'
    assert dealias_type('select one dogs') == 'select_one dogs'
    assert dealias_type('select1 dogs') == 'select_one dogs'
    assert dealias_type('select_one dogs') == 'select_one dogs'