summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/python_append_runme.py
blob: e5f6b07cf1fd7565e5e766ce281d864071f840b6 (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
from python_append import *


# test not relevant for -builtin
if is_python_builtin():
    exit(0)

t = Test()
t.funk()
t.static_func()

if grabpath() != os.path.dirname(mypath):
    raise RuntimeError("grabpath failed")

if grabstaticpath() != os.path.basename(mypath):
    raise RuntimeError("grabstaticpath failed")

clearstaticpath()
if grabstaticpath() != None:
    raise RuntimeError("Resetting staticfuncpath failed")
Test.static_func()
if grabstaticpath() != os.path.basename(mypath):
    raise RuntimeError("grabstaticpath failed")

# slots test
fs = ForSlots()
if fs.ValidVariable != 99:
    raise RuntimeError("ValidVariable failed")
fs.ValidVariable = 11
if fs.ValidVariable != 11:
    raise RuntimeError("ValidVariable failed")
try:
    fs.Invalid = 22
    raise RuntimeError("It should not be possible to set a random variable name")
except AttributeError:
    pass