Beispiel #1
0
def test_ListProperty_as_list_then_dict():
    print()
    print("Test ListProperty as list then dict.")
    lp = ListProperty(l.copy())
    print("BEFORE: {}".format(lp))
    lp.insert('2', 'c')
    print("AFTER: {}".format(lp))
    assert lp._l == resultL
Beispiel #2
0
def test_ListProperty_as_dict_then_list():
    print()
    print("Test ListProperty as list then dict.")
    lp = ListProperty(intD.copy())
    print("BEFORE: {}".format(lp))
    lp.insert('2', 'c')
    print("AFTER: {}".format(lp))
    assert lp._d == {0: 'a', 1: 'b', 2: 'd', '2': 'c'}
Beispiel #3
0
def test_ListProperty_as_list():
    print()
    print("Test ListProperty as list.")
    lp = ListProperty(l.copy())
    sys.stdout.write("{} becomes ".format(lp))
    lp.insert(2, 'c')
    print("{}".format(lp))
    assert lp._l == resultL
Beispiel #4
0
def test_ListProperty_as_dict():
    '''
    This test exists since children is a ListProperty in kivy but a
    dict in Tkinter.
    '''
    print()
    print("Test ListProperty as dict ({}):"
          "".format(test_ListProperty_as_dict.__doc__.strip()))
    lp = ListProperty(intD.copy())
    sys.stdout.write("{} becomes ".format(lp))
    lp.insert(2, 'c')
    print("{}".format(lp))
    assert lp._d == {0: 'a', 1: 'b', 2: 'c', 3: 'd'}