Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 53 lines (46 sloc) 1.608 kB
0e8e6da start of test app gchart
lkcl authored
1 import pyjd
2
3 """*
4 *
5 * Displays the test chart in the browser, and checks the HTML
6 * generated against previous, visually validated, browser
7 * output HTML hash codes to see if HTML output from the test
8 * has changed (possibly due to an error).
9 *
10 * As long as GChart and the test set itself has not changed,
11 * these tests can be performed by first running in hosted
12 * mode, then clicking on the "Compile/Browse" button. If
13 * "Test passed" is displayed in hosted mode and also in
14 * Firefox after the compile (this assumes Firefox is your default browser)
15 * it means that the generated HTML has not changed since
16 * the last time it was visually inspected--test passed.
17 *
18 * If the test or GChart changes so as to change browser output,
19 * you will have to visually verify the charts, and then (assuming the
20 * charts are correct) enter the hashcodes.
21 *
22 * In the most common case where the test and output are unchanged,
23 * the test should go through very quickly.
24 *
25 """
26
27 # convenience method to create a short, class-name-based title
1283293 more gchart update
lkcl authored
28 def getTitle(obj):
29 result = obj.__class__.__name__
0e8e6da start of test app gchart
lkcl authored
30 result = result[:result.rfind(".")+1]
31 return "<h4><br>" + result + "</h4>"
32
33
34 """ Linear congruent random number generator.
35 *
36 * Cannot use GWT's Math.random() because, for automated
37 * testing, we require that the exact same random sequence
38 * be used each time (GWT does not support the JDK's more
39 * generic Random class, which would have allowed this).
40 *
41 * Constants are from Knuth via Numerical Recipes in C.
42 *
43 """
44 i = 0
0b3fad9 more gchart update
lkcl authored
45 def rnd():
0e8e6da start of test app gchart
lkcl authored
46 m = 217728
47 a = 84589
48 c = 45989
49 i = (a*i + c) % m
50 return i/m
51
52
Something went wrong with that request. Please try again.