Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (48 sloc) 1.633 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 """
64eff55 C Anthony Risinger find * -name '*.py' | xargs sed -i -r 's,\s+$,,'
xtfxme authored
26
0e8e6da start of test app gchart
lkcl authored
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 """
6eeab1c more gchart update
lkcl authored
44 global i
0e8e6da start of test app gchart
lkcl authored
45 i = 0
0b3fad9 more gchart update
lkcl authored
46 def rnd():
c90bb3d more gchart update
lkcl authored
47 global i
0e8e6da start of test app gchart
lkcl authored
48 m = 217728
49 a = 84589
50 c = 45989
51 i = (a*i + c) % m
6eeab1c more gchart update
lkcl authored
52 return float(i)/m
0e8e6da start of test app gchart
lkcl authored
53
54
Something went wrong with that request. Please try again.