Ejemplo n.º 1
0
def test_select():
    a = ElementTypeContainer(
        {1: {"key": "Living_room", "id": 1}, 3: {"key": "Kids_room", "id": 3}}
    )

    assert a.select("all") == [1, 3]
    assert a.select("0") == [1, 3]

    assert a.select("Living_room") == [1]

    assert a.select("1") == [1]
Ejemplo n.º 2
0
def test_select():
    a = ElementTypeContainer({
        1: {
            'key': 'Living_room',
            'id': 1
        },
        3: {
            'key': 'Kids_room',
            'id': 3
        }
    })

    assert a.select('all') == [1, 3]
    assert a.select('0') == [1, 3]

    assert a.select('Living_room') == [1]

    assert a.select('1') == [1]
Ejemplo n.º 3
0
def test_select():
    a = ElementTypeContainer({1: {"key": "El 1"}, 2: {"key": "El 2"}})

    assert len(a.select("all")) == 2
    assert a.select("all") == [1, 2]
    assert len(a.select("0")) == 2
    assert a.select("0") == [1, 2]

    assert len(a.select("2")) == 1
    assert a.select("2") == [2]
    assert len(a.select("El 2")) == 1
    assert a.select("El 2") == [2]

    assert len(a.select([1, 2])) == 2
    assert a.select([1, 2]) == [1, 2]
    assert a.select(["El 1", "El 2"]) == [1, 2]