summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/director_detect_runme.py
blob: b9c73eb45f08265ef25407485a03e96222b9b6fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import director_detect


class MyBar(director_detect.Bar):

    def __init__(self, val=2):
        director_detect.Bar.__init__(self)
        self.val = val

    def get_value(self):
        self.val = self.val + 1
        return self.val

    def get_class(self):
        self.val = self.val + 1
        return director_detect.A()

    def just_do_it(self):
        self.val = self.val + 1

    def clone(self):
        return MyBar(self.val)
    pass


b = MyBar()

f = b.baseclass()

v = f.get_value()
a = f.get_class()
f.just_do_it()

c = b.clone()
vc = c.get_value()

if (v != 3) or (b.val != 5) or (vc != 6):
    raise RuntimeError("Bad virtual detection")