Ejemplo n.º 1
0
def test_t_world_new():
    # arrange
    switches = model.Switches()
    # act
    world: t_world = t_world(
        fields_=set(),
        switches=switches,
    )
    # assert
    assert world
Ejemplo n.º 2
0
def test_writer_pattfields_02():
    # arrange
    world : t_world = t_world(
        fields_ = {
            'Vie' : mk_field("Au A Vie umove Mun !"),
            'Mun' : mk_field("Ge A Mun"),
        },
        switches = {}
    )
    # act
    res = writer(world=world)
    # assert
    assert len(res.orders) == 2
    assert res.pattfields == set()  # Mun is not a pattfield
Ejemplo n.º 3
0
def test_writer_01():
    # arrange
    world : t_world = t_world(
        fields_ = {
            'Vie' : mk_field("Au A Vie"),
        },
        switches = {}
    )
    # act
    res = writer(world=world)
    # assert
    assert res.orders == [
        mk_oresult("Au ? Vie hld Vie"),
    ]
    assert res.pattfields == set()
Ejemplo n.º 4
0
def test_writer_02():
    # arrange
    world : t_world = t_world(
        fields_ = {
            'Vie' : mk_field("Au A Vie"),
            'Mun' : mk_field("Ge A Mun umove Vie !"),
            'NTH' : mk_field("En 2 NTH"),
        },
        switches = {}
    )
    # act
    res = writer(world=world)
    # assert
    assert res.orders == [
        mk_oresult("Au A Vie hld Vie"),
        mk_oresult("Ge A Mun hld Vie !"),
        mk_oresult("En 2 NTH hld NTH"),
    ]
    assert res.pattfields == set()