Exemplo n.º 1
0
def test_statechangearray_tobool():
    a = StateChangeArray([0, 1, 0, 2, 0], t=[1, 2, 4, 5, 7], name="a")
    b = a.to_bool(inplace=False)
    assert compare_statechangearrays(
        b,
        BooleanStateChangeArray([False, True, False, True, False],
                                t=[1, 2, 4, 5, 7],
                                name="a"),
    )
    a.to_bool(inplace=True)
    assert a.is_bool()
    assert compare_statechangearrays(a, b)
    return True
Exemplo n.º 2
0
def test_statechangearray_isbool():
    a = StateChangeArray([1, 3, 5, 7], t=[1, 2, 4, 7], name="a")
    assert a.is_bool() is False
    a = StateChangeArray([True, False, True, False], t=[1, 2, 4, 7], name="a")
    assert a.is_bool() is True