Lichen

Annotated tests/contexts.py

503:644952535f7a
2017-01-23 Paul Boddie Added another, shorter test of get_using, commenting the existing test slightly.
paul@2 1
class C:
paul@214 2
    l = [2, 4, 6, 8, 10]
paul@2 3
    s = "test"
paul@2 4
    def __init__(self, x):
paul@2 5
        self.x = x
paul@2 6
        self.y = 3
paul@214 7
        self.z = "zebra libre"
paul@2 8
paul@2 9
c = C([1])
paul@2 10
x = c.x
paul@2 11
f = c.x.__len__
paul@266 12
print c             # <__main__.C instance>
paul@266 13
print x             # [1]
paul@266 14
print f             # __builtins__.list.list.__len__
paul@266 15
print f()           # 1
paul@2 16
paul@2 17
y = c.l
paul@2 18
g = c.l.__len__
paul@266 19
print y             # [2, 4, 6, 8, 10]
paul@266 20
print g             # __builtins__.list.list.__len__
paul@266 21
print g()           # 5
paul@2 22
paul@2 23
yy = C.l
paul@2 24
gg = C.l.__len__
paul@266 25
print yy            # [2, 4, 6, 8, 10]
paul@266 26
print gg            # __builtins__.list.list.__len__
paul@266 27
print gg()          # 5
paul@2 28
paul@2 29
z = c.s
paul@2 30
h = c.s.__len__
paul@266 31
print z             # test
paul@266 32
print h             # __builtins__.str.basestring.__len__
paul@266 33
print h()           # 4
paul@2 34
paul@2 35
zz = C.s
paul@2 36
hh = C.s.__len__
paul@266 37
print zz            # test
paul@266 38
print hh            # __builtins__.str.basestring.__len__
paul@266 39
print hh()          # 4
paul@2 40
paul@2 41
a = c.y
paul@2 42
b = c.z
paul@2 43
i = c.z.__len__
paul@266 44
print a             # 3
paul@266 45
print b             # zebra libre
paul@266 46
print i             # __builtins__.str.basestring.__len__
paul@266 47
print i()           # 11