1
2
3 from GChartWrapper import *
4 from GChartWrapper.encoding import Encoder
5 from GChartWrapper.constants import PY_VER,_print
6 import unittest
7
9 """
10 Extensive unit tests, more are welcome
11
12 All methods should be commented and must return a GChart instance as the last line.
13 """
14
15 all = {
16 'currency_bar':'8ec06bda7223eb500e7f0357efd6e717543d9abb',
17 'financial':'0c3dee619eb6c43d8b5405f537438467a7d736e5',
18 'text_pin':'42558403a2a9d66e9b54deea094114029c86d529',
19 'simple':'1fb72aac2758d164bca43a40472ae185091291b1',
20 'text':'4e1f2755c9f6160d959ed91829543e0687b55a0e',
21 'guide_granularity_20':'1dfcb2ba4444e3c09be3b55221cc04e5a5c0bf32',
22 'pie':'3fe7636938cda678be044848799a2c87ecad6099',
23 'small_bubble_icon':'65d1df5f7bda98cfaea2a96dfe8dcca1058c444c',
24 'guide_granularity_40':'dc7d8714f28d7a59d2b768ecba7f685814a73bd4',
25 'guide_radar':'9703b8ca52e8c38c37353c6935d5053f8120c37a',
26 'icon_pin':'01110b589dbe1ed9aed7a3eb057bd9020b6d21a2',
27 'guide_sparkline':'767bab6609f60b6c7185b0ed0a1434ad9d73f4c7',
28 'guide_bhg':'b051f7ab51afd534f89095fab7db3c161fcb3bc3',
29 'margins':'4f995e40b16a49d0c407c0bf1b536f7642f6253d',
30 'venn':'cf327d123a3a2fdf04620a966903fc20f096f82c',
31 'fill':'1766f4b8b774d41985a4a3b2ab3f9791dedab2a3',
32 'guide_line_lc':'11ec3b84d8de22e8bf6a32cbca3b62374aa68a46',
33 'large_bubble_icon_texts':'20c705a0e3038594749b8b9cdf8f09e470e76b17',
34 'large_bubble_texts':'ff1474c87defa687727a4ee42dca9c641a46668c',
35 'guide_granularity_300':'0d5a40563ad832312bd357564a9da9787e38d6ef',
36 'large_bubble_icon':'f09ebedf3cc5c461604539afdcff9dac09817d71',
37 'adv_icon_pin':'b8a2ec08aeb3fb0a839598a82dfba02c7cdc8638',
38 'axes':'6040f894d8e71160b9e87541f7ef9db224efae9c',
39 'qr_code':'bdcea2f3b1dbb331de2ed8a730736c99f2d81c90',
40 'markers':'fc7ab02d17a07a611a02b0a4dda7763c4bfec712',
41 'guide_granularity_80':'014f1a251dab5fa14fdadf7868b64a210bb1cf5e',
42 'axes_position':'7d6d5d0fa5565ef3e1069ba91db472484a339696',
43 'jacobian':'6d0d251ac640c0d5185124cb5ea9ccc636268f14',
44 'multiline':'5f27957e39363ca470c0e97d1fcffdc19fa00afb',
45 'numpy':'9b0fb89df43d69b64755153b919e598180fc1a9d',
46 'guide_meter':'cdad708a80c49b705212d098bf83f9ccb30610aa',
47 'letter_pin':'430c921aa8d73e80feae07b2ba04909c6a6b1ab3',
48 'guide_granularity_150':'35281ef165d532021290c003e2068527d40003b0',
49 'guide_intro':'0b3b189c0675fd51bda46714706e3f7dfb4164dc',
50 'thought_note':'9375cabf12b442764db34862c68ae74f85c42ca9',
51 'czech_and_unicode':'ead386ad75dabb21e13fd4b3a357d6025bdd4506',
52 'guide_bvg':'36ce2efaf74fad1912b8351147b821d0253f9c56',
53 'min_max':'5aae24644331ca33c0cb83dc01a34d389edd6adf',
54 'guide_bhs':'a1d1801762105d58f67c544be36e2af7bf69a2a8',
55 'guide_map':'2391235ee09f58cc194eaf16b3c87f839613ebc5',
56 'guide_bvs':'e65f1bea45ae7197943366d8de1268aad6e5b66d',
57 'grid':'90953636424f46e568bf8a316efbba4df0461eef',
58 'legend2':'acc8c1a1199e2363fee076486365b6f8a29e72a0',
59 'line':'9b6f9a566b49fa23c91a6f992e4a4737caac4ae5',
60 'guide_chbh_size':'a6b043ed705fe90afef78c393403fc813ca7aa1e',
61 'legend':'33cd2c7acdc4aa9745ed95a0aa1ff641525adf5c',
62 'adv_letter_pin':'97cd7dac85adad57e2cf8209d0795a4f5216cb6a',
63 'sticky_note':'a3a55893fc130abd814c80c9841e3547e2c2877a',
64 'bar':'d3251fb77a28a5918955020c745fa435b0f4a314',
65 'bar_text':'c01b4efa34a4850f6888ebcde3d9ee28ba621f85',
66 'title':'40d64c1c3aeb9c3836e501033c4bf65da2ff2f83',
67 'tick_marks':'9cab6532523a353cd87d3edec45d9222de9dde5d',
68 'concentric_pie':'cb6325bb97779fabdc77c8ab76e6bf4ed1d5447b',
69 'hvz':'7a890b9c2c6016faff3cb6789d9732a5caf8fa9d',
70 'guide_chbh_clipped':'83ff879fc173bbcf80350d62d7d880b619424d10',
71 'guide_bvs_scale':'a327b4be8fa55deccba5b4baab7680c75f621064',
72 'weather_note':'9a7988231bc235bda5ab21e19288fba5b554adf7',
73 'markerfill':'95664c2d4aeae5bcb94b1b003b361e2035d44e64',
74 'packman':'2cd25d4a258abb9d62d144668e3cb54f71b01af1',
75 'interval':'5e60f45fb27f32aefe048d9eb22f17a7d117c162',
76 'bar_zero':'94219f27b54883078db0ef744292a40e46de2da7',
77 'omitted_colors':'bc72f51d748767fc1692b6a227d5184415e9e2f5',
78 'scatter':'36f99c6a7e93af8d164af220ae626c10002f808e',
79 'fancy_radar':'049d0fe4a213204e8e31f07658c7a665ea866698',
80 'legend_position':'5f2d550e98ae1a85312b4d7e33761d30ca89acfd',
81 'circle_diamonds':'0e02091bfe03d6cf31704c87de01dea6c47e3717',
82 }
83
86
88 chart_name = rep.split('test_')[1][:-1]
89 self.assertEqual(self.all[chart_name], chart.checksum(),
90 '%s: %s != %s'%(chart_name,self.all[chart_name],chart.checksum()))
91
93 G = Scatter([[12,87,75,41,23,96,68,71,34,9],[98,60,27,34,56,79,58,74,18,76],[84,23,69,81,47,94,60,93,64,54]])
94 G.axes('xy')
95 G.axes.label(0, 0,20,30,40,50,60,70,80,90,10)
96 G.axes.label(1, 0,25,50,75,100)
97 G.size(300,200)
98 self._test_a_chart(repr(self), G)
99 return G
100
102 G = RadarSpline(['voJATd9v','MW9BA9'],encoding='simple')
103 G.color('red','orange')
104 G.size(400,400)
105 G.line(2,4,0)
106 G.line(2,4,0)
107 G.axes('x')
108 G.axes.label(0, 0,45,90,135,180,225,270,315)
109 G.axes.range(0, 0.0,360.0)
110 G.grid(25.0,25.0,4.0,4.0)
111 G.marker('B','FF000080',0,1.0,5.0)
112 G.marker('B','FF990080',1,1.0,5.0)
113 G.marker('h','blue',0,1.0,4.0)
114 G.marker('h','3366CC80',0,0.5,5.0)
115 G.marker('V','00FF0080',0,1.0,5.0)
116 G.marker('V','008000',0,5.5,5.0)
117 G.marker('v','00A000',0,6.5,4)
118 self._test_a_chart(repr(self), G)
119 return G
120
122 G = Line([[20,10,15,25,17,30],[0,5,10,7,12,6],[35,25,45,47,24,46],[15,40,30,27,39,54],[70,55,63,59,80,60]],encoding='text',series=1)
123 G.scale(0,100,-50,100)
124 G.marker('F','',1,'1:4',20)
125 self._test_a_chart(repr(self), G)
126 return G
127
134
143
150
163
165
166 G = VerticalBarGroup( [[31],[59],[4]], encoding='text' )
167 G.scale(0,59)
168 G.color('lime','red','blue')
169 G.legend('Goucher(31)','Truman(59)','Kansas(4)')
170 G.fill('c','lg',45,'cccccc',0,'black',1)
171 G.fill('bg','s','cccccc')
172 G.size(200,100)
173 self._test_a_chart(repr(self), G)
174 return G
175
177
178
179 G = QRCode('''To the human eye QR Codes look like hieroglyphics,
180 but they can be read by any device that has
181 the appropriate software installed.''')
182
183 G.output_encoding('UTF-8')
184
185 G.level_data('M',0)
186 self._test_a_chart(repr(self), G)
187 return G
188
190
191 G = Line( ['GurMrabsClgubaolGvzCrgrefOrnhgvshyvforggregunahtyl'] )
192 G.title('The Zen of Python','00cc00',36)
193 G.color('00cc00')
194 self._test_a_chart(repr(self), G)
195 return G
196
198
199
200 G = Line( ['hX1xPj'] )
201 G.axes('xy')
202 G.axes.label(0, 'Mar', 'Apr', 'May', 'June', 'July')
203 G.axes.label(1, None, '50+Kb')
204 G.color('red')
205 G.line(6,5,2)
206 self._test_a_chart(repr(self), G)
207 return G
208
217
225
232
234
235
236
237 G = Line( ['foobarbaz'] )
238 G.color('76A4FB')
239 G.axes('xyrx')
240 G.axes.label(0,'Foo', 'Bar', 'Baz')
241 G.axes.style(0, '0000dd', 14)
242 G.axes.label(1, None, '20K', '60K', '100K')
243 G.axes.label(2, 'A', 'B', 'C')
244 G.axes.label(3, None,'20','40','60','80')
245 self._test_a_chart(repr(self), G)
246 return G
247
249
250
251 G = Line( ['foobarbaz'] )
252 G.color('76A4FB')
253 G.line(3,6,3)
254 G.grid(20.0,25.0,1,0)
255 self._test_a_chart(repr(self), G)
256 return G
257
259
260 G = Line( ['helloWorldZZZZ098236561'] )
261 G.marker('c','red',0,1,20)
262 G.marker('d','80C65A',0,6,15)
263 G.marker('o','FF9900',0,4.0,20.0)
264 G.marker('s','3399CC',0,5.0,10.0)
265 G.marker('v','BBCCED',0,6.0,1.0)
266 G.marker('V','3399CC',0,7.0,1.0)
267 G.marker('x','FFCC33',0,8.0,20.0)
268 G.marker('h','black',0,0.30,0.5 )
269 G.marker('a','000099',0,4,10)
270 G.marker('R','A0BAE9',0,8,0.6)
271 G.marker('r','E5ECF9',0,1,0.25)
272 self._test_a_chart(repr(self), G)
273 return G
274
276
277 G = Line(['ALAtBmC1EcGYIsLWOXRuVdZhd9ivn4tYzO5b..'],encoding='extended')
278 G.size(300,200)
279 G.color('cc0000')
280 G.fill('c','s','eeeeee')
281 G.legend('Sweet')
282 self._test_a_chart(repr(self), G)
283 return G
284
286
287 G = Line( ['99','cefhjkqwrlgYcfgc',
288 'QSSVXXdkfZUMRTUQ','HJJMOOUbVPKDHKLH','AA'] )
289 G.marker('b','76A4FB',0,1,0)
290 G.marker('b','224499',1,2,0)
291 G.marker('b','red',2,3,0)
292 G.marker('B','80C65A',3,4,0)
293 self._test_a_chart(repr(self), G)
294 return G
295
297
298 G = Line( ['pqokeYONOMEBAKPOQVTXZdecaZcglprqxuux393ztpoonkeggjp'] )
299 G.color('red')
300 G.line(4,3,0)
301 G.axes('xy')
302 G.axes.label(0, 1,2,3,4,5)
303 G.axes.label(1, None,50,100)
304 G.fill('c','lg',45,'white',0,'76A4FB',0.75)
305 G.fill('bg','s','EFEFEF')
306 self._test_a_chart(repr(self), G)
307 return G
308
309
311
312 G = Line( ['FOETHECat','leafgreen','IRON4YOUs'] )
313 G.color('red','lime','blue')
314 G.legend('Animals','Vegetables','Minerals')
315 G.axes('y')
316 self._test_a_chart(repr(self), G)
317 return G
318
320
321 G = Line( ['abcde','FGHIJ','09876'] )
322 G.color('red','lime','blue')
323 G.legend('Animals','Vegetables','Minerals')
324 G.legend_pos('l')
325 G.axes('y')
326 self._test_a_chart(repr(self), G)
327 return G
328
330
331 G = Venn([100,20,20,20,20,0,0])
332 G.legend('First','Second','Third')
333 G.legend_pos('t')
334 G.color('red','lime','blue')
335 self._test_a_chart(repr(self), G)
336 return G
337
339
340 G = LineXY( [
341 [0,30,60,70,90,95,100],
342 [20,30,40,50,60,70,80],
343 [10,30,40,45,52],
344 [100,90,40,20,10],
345 ['-1'],
346 [5,33,50,55,7],
347 ])
348 G.scale(0,100)
349 G.color('3072F3','red','00aaaa')
350 G.marker('s','red',0,-1,5)
351 G.marker('s','blue',1,-1,5)
352 G.marker('s','00aa00',2,-1,5)
353 G.line(2,4,1)
354 self._test_a_chart(repr(self), G)
355 return G
356
358
359
360 data = [[4.6, 6.0, 7.4, 11.6, 12.0, 14.8, 18.1, 25.1,
361 27.9, 28.3, 30.6, 34.4, 43.7, 48.3, 57.6, 64.6,
362 72.5, 74.4, 76.2, 77.2, 86.0, 86.9, 93.9, 96.7, 99.0],
363 [80.5, 100.0, 95.4, 93.7, 96.3, 91.7, 71.5, 63.0,
364 65.2, 65.5, 66.0, 75.9, 65.8, 64.4, 64.2, 62.5, 37.2,
365 35.3, 32.4, 35.2, 38.4, 37.9, 69.8, 38.0, 64.5]]
366
367
368 axis = [ [0, 13, 28, 42, 56, 71, 84, 100],
369 ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'] ]
370
371
372 min_value = float(min(data[1]))
373 max_value = float(max(data[1]))
374 last_value = float(data[1][-1])
375
376 G = LineXY(data, encoding='text')
377 G.color('76A4FB')
378 G.marker('o', '0077CC',0,-1,5)
379 G.marker('r', 'E6F2FA',0,(min_value/max_value),1.0)
380 G.axes("xyr")
381 G.axes.label(0, *axis[1])
382 G.axes.position(0, *axis[0])
383 G.axes.label(1, '%d'%min_value, '%d'%max_value)
384 G.axes.position(1, int(100*min_value/max_value),100)
385 G.axes.label(2, '%d'%last_value)
386 G.axes.position(2, int(100*last_value/max_value))
387 self._test_a_chart(repr(self), G)
388 return G
389
390
391
392
399
401 G = Line('fohmnytenefohmnytene', encoding='simple')
402 G.size(200,100)
403 G.axes('xy')
404 G.axes.label(0, 'April','May','June')
405 G.axes.label(1, None, '50+Kb')
406 self._test_a_chart(repr(self), G)
407 return G
408
410 G = Line('frothsmzndyoteepngenfrothsmzndyoteepngen', encoding='simple')
411 G.size(200,100)
412 G.axes('xy')
413 G.axes.label(0, 'April','May','June')
414 G.axes.label(1, None, '50+Kb')
415 self._test_a_chart(repr(self), G)
416 return G
417
419 G = Line('formostthisamazingdayfortheleapinggreenlformostthisamazingdayfortheleapinggreenl',
420 encoding='simple')
421 G.size(200,100)
422 G.axes('xy')
423 G.axes.label(0, 'April','May','June')
424 G.axes.label(1, None, '50+Kb')
425 self._test_a_chart(repr(self), G)
426 return G
427
429 G = Line('ithankYouGodformostthisamazingdayfortheleapinggreenlyspiritsoftreesandabluetruedreamofskyandforeverythingwhichisnaturalwhichisinfinitewhichisyeseecumm',
430 encoding='simple')
431 G.size(200,100)
432 G.axes('xy')
433 G.axes.label(0, 'April','May','June')
434 G.axes.label(1, None, '50+Kb')
435 self._test_a_chart(repr(self), G)
436 return G
437
439 G = Line('ithankYouGodformostthisamazingdayfortheleapinggreenlyspiritsoftreesandabluetruedreamofskyandforeverythingwhichisnaturalwhichisinfinitewhichisyesithankYouGodformostthisamazingdayfortheleapinggreenlyspiritsoftreesandabluetruedreamofskyandforeverythingwhichisnaturalwhichisinfinitewhichisyeseecummings',
440 encoding='simple')
441 G.size(200,100)
442 G.axes('xy')
443 G.axes.label(0, 'April','May','June')
444 G.axes.label(1, None, '50+Kb')
445 self._test_a_chart(repr(self), G)
446 return G
447
454
455
456
458
459 G = Sparkline([27,25,25,25,25,27,100,31,25,36,25,25,39,
460 25,31,25,25,25,26,26,25,25,28,25,25,100,28,27,31,25,
461 27,27,29,25,27,26,26,25,26,26,35,33,34,25,26,25,36,25,
462 26,37,33,33,37,37,39,25,25,25,25], encoding='text')
463 G.color('0077CC')
464 G.size(200,40)
465 G.marker('B', 'E6F2FA',0,0,0)
466 G.line(1,0,0)
467 self._test_a_chart(repr(self), G)
468 return G
469
470
478
480 G = VerticalBarStack([ [10,50,60,80,40],[50,60,100,40,20] ], encoding='text')
481 G.color('4d89f9', 'c6d9fd')
482 G.size(200,125)
483 self._test_a_chart(repr(self), G)
484 return G
485
487 G = VerticalBarStack([ [10,50,60,80,40],[50,60,100,40,20] ], encoding='text')
488 G.color('4d89f9', 'c6d9fd')
489 G.size(200,125)
490 G.scale(0,160)
491 self._test_a_chart(repr(self), G)
492 return G
493
500
507
514
522
524
525 G = Radar([ [77,66,15,0,31,48,100,77],[20,36,100,2,0,100] ], encoding='text')
526 G.size(200,200)
527 G.color('red','FF9900')
528 G.line(2,4,0)
529 G.line(2,4,0)
530 G.axes('x')
531 G.axes.label(0, 0,45,90,135,180,225,270,315)
532 G.axes.range(0, 0,360)
533 self._test_a_chart(repr(self), G)
534 return G
535
537
538 G = Map('fSGBDQBQBBAGABCBDAKLCDGFCLBBEBBEPASDKJBDD9BHHEAACAC', encoding='simple')
539 G.color('f5f5f5','edf0d4','6c9642','365e24','13390a')
540 G.fill('bg','s','eaf7fe')
541 G.size(440,220)
542 G.map('usa', 'NYPATNWVNVNJNHVAHIVTNMNCNDNELASDDCDEFLWAKSWIORKYMEOHIAIDCTWYUTINILAKTXCOMDMAALMOMNCAOKMIGAAZMTMSSCRIAR')
543 self._test_a_chart(repr(self), G)
544 return G
545
553
555
556
557 data = [10,20,30,40,50,60,70,80,90]
558 try:
559 from numpy import array
560 data = array(data)
561 except ImportError:
562 _print('Warning: numpy must be installed to do this test correctly')
563 G = Radar(data, encoding='text')
564 G.size(200,200)
565 self._test_a_chart(repr(self), G)
566 return G
567
574
576
577 G = Line([[0,5,10,7,12,6],[35,25,45,47,24,46],[15,40,30,27,39,54],[70,55,63,59,80,60]], encoding='text')
578 G.marker('F','blue',0,'1:4',20)
579 G.size(200,125)
580 self._test_a_chart(repr(self), G)
581 return G
582
583 - def test_bar_text(self):
584
585 G = HorizontalBarGroup([[40,60],[50,30]], encoding='text')
586 G.size(200,125)
587 G.marker('tApril mobile hits','black',0,0,13)
588 G.marker('tMay mobile hits','black',0,1,13,-1)
589 G.marker('tApril desktop hits','black',1,0,13)
590 G.marker('tMay desktop hits', 'black',1,1,13)
591 G.color('FF9900','FFCC33')
592 self._test_a_chart(repr(self), G)
593 return G
594
596 G = Line(['Uf9a','a3fG'], encoding='simple')
597 G.size(250,100)
598 G.label(1,2,3,4)
599 G.fill('bg','s','e0e0e0')
600 G.color('black','blue')
601 G.margin(20,20,20,30,80,20)
602 G.legend('Temp','Sales')
603 self._test_a_chart(repr(self), G)
604 return G
605
607 G = Line('mHMza', encoding='simple')
608 G.color('008000')
609 G.line(2.0,4.0,1.0)
610 G.size(200,140)
611 G.axes('x')
612 G.axes.label(0, None,'t',None,'F',None)
613 G.marker('tMin','blue',0,1,10)
614 G.marker('fMax','red',0,3,15)
615 G.margin(0,0,30,0)
616 self._test_a_chart(repr(self), G)
617 return G
618
619 - def test_text(self):
620
621
622 text = '''
623 1600 Ampitheatre Parkway
624 Mountain View, CA
625 (650)+253-0000
626 '''
627 G = Text('darkred',16,'h','red','b',text)
628 self._test_a_chart(repr(self), G)
629 return G
630
632
633 G = Pin('pin_letter','A','red','black')
634 self._test_a_chart(repr(self), G)
635 return G
636
638
639 G = Pin('pin_icon','home','yellow')
640 self._test_a_chart(repr(self), G)
641 return G
642
644 G = Pin('xpin_letter','star','A','aqua','black','red')
645 self._test_a_chart(repr(self), G)
646 return G
647
649
650 G = Pin('xpin_icon','star','home','aqua','red')
651 self._test_a_chart(repr(self), G)
652 return G
653
654 - def test_text_pin(self):
655
656 G = Pin('spin',1.2,30,'FFFF88',10,'_','Foo\nBar')
657 self._test_a_chart(repr(self), G)
658 return G
659
661
662 G = Note('note_title','pinned_c',1,'darkgreen','l',"Joe's\nToday 2-for-1 !\n555-1234")
663 self._test_a_chart(repr(self), G)
664 return G
665
667
668 G = Note('note','thought',1,'navy','h',"wouldn't it be\ngreat to eat\nat Joe's?")
669 self._test_a_chart(repr(self), G)
670 return G
671
673
674 G = Note('weather','taped_y','sunny','Barcelona','max 25°','min 15°')
675 self._test_a_chart(repr(self), G)
676 return G
677
679
680 G = Bubble('icon_text_small','petrol','bb','$3/gal','khaki','black')
681 self._test_a_chart(repr(self), G)
682 return G
683
685
686 G = Bubble('icon_text_big','snack','bb','$2.99','ffbb00','black')
687 self._test_a_chart(repr(self), G)
688 return G
689
691
692 G = Bubble('icon_texts_big','petrol','bb','khaki','black','LoCost Fuel\n$3.05/gal unleaded\n$2.10/gal diesel')
693 self._test_a_chart(repr(self), G)
694 return G
695
697
698 G = Bubble('texts_big','bb','teal','khaki',"Joe\'s Restaurant\n123 Long St\n92745 Mountain View")
699 self._test_a_chart(repr(self), G)
700 return G
701
710
712 G = Line('cEAELFJHHHKUju9uuXUc', encoding="simple")
713 G.color('76A4FB')
714 G.size(220, 125)
715 G.line(2)
716 G.axes('xyrx')
717 G.axes.range(1, 0,4)
718 G.axes.label(2, 'min','avg','max')
719 G.axes.label(3, 'Jan','Feb','Mar')
720 G.axes.style(2, '0000DD',13,-1,'t','FF0000')
721 G.axes.position(2, 10,35,95)
722 G.axes.tick(1,10)
723 G.axes.tick(2,-180)
724 self._test_a_chart(repr(self), G)
725 return G
726
728 G = VerticalBarStack([43.56,35.62,48.34,57.50,67.30,60.91])
729 G.color('blue')
730 G.bar(17,15)
731 G.marker('N*cEUR1*','black',0,-1,11)
732 self._test_a_chart(repr(self), G)
733 return G
734
736 G = Line(['Hello','world'])
737 G.marker('o','ff9900',0,-1,15.0)
738 G.marker('d','ff0000',1,-1,10.0)
739 self._test_a_chart(repr(self), G)
740 return G
741
743 url='http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'
744 self.assertEqual(GChart.fromurl(url).checksum(),'4e53c7add42ce61a933ce106a9854222c54c9147')
745
750
753
755 self._test_encoding('text', 't:0.0,10.0,100.0,-1.0,-1.0', [0,10,100,-1,-1], (0,100))
756
758 self._test_encoding('extended', 'e:AH-HAA..', [7,3975,0,4095], 4095)
759
762
770
771 if __name__ == '__main__':
772 import sys
773 calls = {
774 'unit': lambda: unittest.main(),
775 'save': lambda: saveall(),
776 }
777 arg = sys.argv[-1]
778 sys.argv = sys.argv[:-1]
779 if arg in calls:
780 calls[arg]()
781 else:
782 for chart in TestChartTypes.all:
783 _print( chart,'\t',get_chart(chart))
784