1 |
from __future__ import nested_scopes |
from __future__ import nested_scopes |
2 |
import sys |
import sys |
3 |
import traceback |
import traceback |
4 |
|
import jarray |
5 |
needGL() |
needGL() |
6 |
|
|
7 |
import gzz |
import gzz |
61 |
failUnlessEqual(s.width, 612) |
failUnlessEqual(s.width, 612) |
62 |
failUnlessEqual(s.height, 792) |
failUnlessEqual(s.height, 792) |
63 |
|
|
64 |
|
def testSize(): |
65 |
|
|
66 |
|
s = sc.getCurrent().getSize() |
67 |
|
z = jarray.zeros(2, "f") |
68 |
|
PageSpanCellView().getSize(enfMaker.makeEnfilade(sc.getCurrent()), None, z, None) |
69 |
|
|
70 |
|
failUnlessApprox(.1, z[0], 2 * 612) |
71 |
|
failUnlessApprox(.1, z[1], 792) |
72 |
|
|
73 |
def testSimply(): |
def testSimply(): |
74 |
"""Test that the view renders something |
"""Test that the view renders something |
75 |
|
|
78 |
passed = 0 |
passed = 0 |
79 |
|
|
80 |
for i in range(0, 50): |
for i in range(0, 50): |
81 |
gzz.client.AbstractUpdateManager.tickIdle() |
for j in range(0, 20): |
82 |
|
gzz.client.AbstractUpdateManager.tickIdle() |
83 |
|
|
84 |
vs = getvs() |
vs = getvs() |
85 |
vs.map.put(SolidBgVob(Color.yellow)) |
vs.map.put(SolidBgVob(Color.yellow)) |
101 |
passed = 1 |
passed = 1 |
102 |
break |
break |
103 |
|
|
104 |
Thread.sleep(300) |
Thread.sleep(200) |
105 |
|
|
106 |
failUnlessEqual(passed, 1, "didn't get the image " + exc) |
failUnlessEqual(passed, 1, "didn't get the image " + exc) |
107 |
|
|