Merge lp:~nataliabidart/magicicada-gui/main-window-iconifiable into lp:magicicada-gui

Proposed by Natalia Bidart
Status: Merged
Merged at revision: 17
Proposed branch: lp:~nataliabidart/magicicada-gui/main-window-iconifiable
Merge into: lp:magicicada-gui
Prerequisite: lp:~nataliabidart/magicicada-gui/logo-rainbow
Diff against target: 229 lines (+63/-19)
6 files modified
data/media/logo.svg (+8/-8)
data/ui/gui.glade (+1/-0)
magicicada/__init__.py (+10/-5)
magicicada/helpers.py (+5/-3)
magicicada/tests/__init__.py (+19/-0)
magicicada/tests/test_magicicada.py (+20/-3)
To merge this branch: bzr merge lp:~nataliabidart/magicicada-gui/main-window-iconifiable
Reviewer Review Type Date Requested Status
Facundo Batista Needs Fixing
Review via email: mp+25377@code.launchpad.net

Commit message

Added test case and functionality for bug #568209 ("The main window should iconifiable").

Description of the change

Added test case and functionality for bug #568209 ("The main window should iconifiable").

To post a comment you must log in.
Revision history for this message
Facundo Batista (facundo) wrote :

Massive errors, 31 times the following:

======================================================================
ERROR: SyncDaemon instance is shutdown at destroy time.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 117, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/utils.py", line 191, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/home/facundo/devel/reps/magicicada/review_logo-rainbow/magicicada/tests/test_magicicada.py", line 60, in tearDown
    self.ui.on_main_window_destroy(self.ui.main_window)
  File "/home/facundo/devel/reps/magicicada/review_logo-rainbow/magicicada/__init__.py", line 95, in on_main_window_destroy
    self.shutdown()
  File "/home/facundo/devel/reps/magicicada/review_logo-rainbow/magicicada/__init__.py", line 85, in shutdown
    reactor.stop() # instead of: gtk.main_quit()
  File "/usr/lib/python2.6/dist-packages/twisted/trial/unittest.py", line 854, in _
    return self._reactorMethods[name](*a, **kw)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/base.py", line 552, in stop
    "Can't stop reactor that isn't running.")
ReactorNotRunning: Can't stop reactor that isn't running.

Most probably because a bad merge (was a criss cross one).

Please land the other branches, and merge this against trunk, and I'll check again.

Thanks!

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'data/media/logo-016.png'
2Binary files data/media/logo-016.png 1970-01-01 00:00:00 +0000 and data/media/logo-016.png 2010-05-15 17:39:29 +0000 differ
3=== modified file 'data/media/logo.svg'
4--- data/media/logo.svg 2010-05-15 17:39:28 +0000
5+++ data/media/logo.svg 2010-05-15 17:39:29 +0000
6@@ -460,7 +460,7 @@
7 inkscape:pageshadow="2"
8 inkscape:zoom="0.45281676"
9 inkscape:cx="108.47293"
10- inkscape:cy="324.31493"
11+ inkscape:cy="319.89813"
12 inkscape:document-units="px"
13 inkscape:current-layer="layer1"
14 showgrid="false"
15@@ -513,17 +513,17 @@
16 style="fill:#000000"
17 d="m 349.08468,846.90605 c 0.26917,10.7682 3.2281,21.30128 7.9375,30.90625 20.46429,-10.79074 26.0108,-35.28275 35.125,-54.875 6.20007,-14.24125 12.82573,-30.33655 26.5625,-38.78125 1.58611,-0.4174 6.39597,-3.3676 4.84375,0.625 -2.19091,16.535 -11.81523,31.4283 -15.86937,46.23719 0.81854,14.2695 -15.6966,12.97272 -9.13063,35.29406 7.83221,14.15213 27.26199,16.11051 41.3125,11.1875 17.25691,-7.58089 35.86376,-11.04582 53.92492,-16.28831 25.14777,-7.07842 50.84819,-13.47303 74.56626,-24.4093 31.24631,-24.55204 70.89713,-36.37274 100.69632,-63.05234 21.97923,-15.0095 41.83869,-33.9648 67.53125,-42.5938 29.21493,-13.0907 54.01114,-35.8582 84.78125,-45.9062 4.75508,-5.2173 11.73563,-9.2063 13.71875,-16.6563 14.63684,-11.1457 -14.59993,6.2284 -22.09375,8.875 -4.77817,2.4994 -13.13233,5.3388 -15.96875,-1.2187 -5.8151,-4.7879 -28.72679,-10.5161 -40.61584,-14.2408 -6.65387,-4.5106 -17.08712,-10.6388 -13.63416,-19.6968 5.90007,-19.1913 23.71274,-31.6622 40.59124,-40.4593 9.6801,-5.0391 20.85081,-7.1229 31.62751,-4.9781 9.40465,0.4529 17.77799,-7.5951 17.4375,-17.0938 1.29543,-11.1981 -1.73524,-23.1209 3,-33.6562 27.92405,-21.0104 64.37995,-21.772 97.82525,-25.4466 16.2585,-1.3349 32.4519,-4.199 48.1435,-8.2097 8.5671,-1.2676 17.4661,5.1766 17.3125,14.1875 1.65252,10.9769 -4.087,21.1727 -11.5129,28.67 -3.7866,5.7712 -8.4485,11.2367 -15.0183,13.6738 -27.7535,18.9167 -63.0765,15.9836 -95.1562,15.9108 -12.6139,-0.1127 -25.2536,0.3798 -37.7501,2.1829 9.35565,11.8615 25.4177,14.3192 39.6563,12.9375 17.1795,-0.9013 34.0785,-4.9579 51.1875,-5.6562 8.4681,7.1659 22.0677,9.7867 30.6875,1.375 11.8918,-8.7447 20.0476,-21.5467 31.375,-30.7813 8.40132,-9.389 12.75382,-21.3848 21.02592,-30.9794 10.5256,-14.3725 19.1114,-30.3755 30.3803,-44.1143 6.9187,-5.8613 9.9597,-14.7166 12.6563,-22.9376 4.9385,-8.8188 3.604,-19.7943 8.5044,-28.7499 3.8438,-11.3712 10.8722,-21.1603 16.9956,-31.2813 8.3168,-18.1676 19.265,-35.65521 20.75,-56.03121 0.9855,-6.1022 0.023,-13.2484 0.5312,-18.7188 5.1817,-2.8741 6.2191,-10.0524 9.3304,-14.7806 10.6524,-21.1581 11.6565,-45.3836 16.1307,-68.3712 5.8077,-36.6164 8.5496,-76.0408 -6.1798,-110.9107 -8.8486,-20.6039 -28.6418,-34.2076 -49.9326,-39.485304 -23.7116,-6.0042 -49.4405,-4.1252 -72.2289,4.509604 -98.00342,48.8699 -183.35901,119.6913 -258.64805,198.5468 -17.22945,14.8334 -33.4177,30.6946 -49.31552,46.8352 -78.6551,70.57961 -143.05563,155.02661 -207.92413,238.16261 -39.10861,58.9335 -82.23211,115.9059 -111.77012,180.4144 -3.94725,14.62 -24.16747,45.575 -21.462,58.29795 -1.43956,7.08577 -2.17394,14.27225 -1.9375,21.53125 z m 84.75,13.84375 c 12.19456,-10.36481 27.43507,-16.59452 42.81555,-20.43339 18.33392,-9.87646 36.93366,-19.82574 55.9032,-28.66036 41.11408,-19.9245 83.77577,-36.1306 126.37806,-52.5489 7.61222,-3.1832 15.21211,-6.382 23.18444,-8.4823 -12.92947,10.909 -28.49911,18.0804 -42.35566,27.705 -44.79045,27.78 -92.01196,52.74492 -143.69642,64.67239 -19.861,1.97104 -42.96917,16.88658 -62.22917,17.74756 z m 2.15625,-31.625 c 1.32849,-8.64139 7.93128,-15.75195 13.87523,-21.85125 14.45037,-12.3347 32.93845,-18.7363 48.78189,-29.186 43.24286,-25.4972 85.73746,-52.4123 129.45153,-76.9441 30.70001,-18.4504 63.1991,-38.5234 100.26635,-38.5499 8.11827,0.3333 16.85237,1.6363 24.375,3.375 3.85604,2.0097 10.71973,3.58 14.875,7.5313 9.45738,6.3837 9.37105,22.5028 -1.21875,27.6874 -10.32228,5.5451 -22.32651,6.3887 -33.11131,10.8902 -64.49445,20.2383 -127.14652,46.1279 -189.47387,71.922 -31.04813,13.7115 -60.1996,31.4223 -90.41482,46.7191 -5.20403,1.11575 -12.87373,4.89018 -17.125,0.375 -0.22769,-0.62887 -0.23175,-1.30969 -0.28125,-1.96875 z m 3.03125,-82.28125 c 2.05845,-19.5041 15.12655,-35.1816 26.65625,-50.125 34.9546,-54.7159 70.64072,-109.3294 110.5625,-160.6875 29.80867,-33.2517 51.54343,-74.3295 87.84375,-101.125 4.33677,-3.1584 12.56449,-3.5327 13.84375,3 5.46259,16.7762 -3.69234,33.4147 -9.75,48.6875 -23.2926,49.3671 -68.22953,84.1812 -96.38255,130.4729 -18.36505,41.0458 -56.13664,68.3742 -87.05849,99.6015 -10.32541,8.8655 -18.66953,19.9734 -29.09021,28.5193 -4.41448,3.0506 -10.82713,6.3154 -16,4.3126 -0.54293,-0.7678 -0.51877,-1.7509 -0.625,-2.6563 z m 19.03125,26.4063 c 3.1557,-16.4732 20.87384,-22.2647 31.83314,-32.6061 31.91166,-26.9271 55.1502,-65.111 94.06679,-83.2532 39.31319,-20.1325 79.24089,-39.8051 114.22507,-66.922 25.00706,-16.9893 42.91529,-45.1071 73.34375,-53.0937 7.7929,-1.1146 15.83845,-0.9939 23.3125,-3.7188 13.29069,-2.1448 25.87061,8.9622 27.03125,21.875 1.28574,7.9728 -0.34331,16.4088 -4.34375,23.4688 -12.68375,4.825 -25.69081,8.348 -38.9375,10.9062 -23.15681,7.4568 -35.26022,30.4723 -49.8125,48.1875 -5.90201,6.9554 -13.40537,14.1737 -23.21035,13.7231 -46.55799,6.4308 -86.81567,32.507 -126.9408,55.1887 -38.41015,22.7558 -75.87383,47.4316 -116.59885,65.6819 -1.28502,0.2595 -2.69823,0.8826 -3.96875,0.5626 z m 132.34375,-145.5313 c 13.80462,-35.2687 46.34122,-57.3516 67.70268,-87.4557 16.00341,-20.8253 37.0322,-37.0896 58.39611,-52.5063 25.02598,-18.4092 48.66206,-38.7687 70.98262,-60.1872 19.74619,-17.5693 42.37151,-35.5322 69.51239,-38.6633 6.2927,-0.3166 16.1025,-0.3566 18.1875,7.0938 1.3202,14.4414 -8.8108,26.4222 -15.3438,38.3437 -6.0741,8.2821 -9.6213,19.6623 -19.80162,23.7064 -52.97977,29.9225 -96.13313,74.0288 -144.32338,110.6373 -34.71223,20.18 -65.01076,51.209 -105.40625,59.2813 l 0.0937,-0.25 5e-5,0 z m 102.21875,-158.8437 c 4.72671,-15.0269 0.36909,-30.2945 6.8125,-44.8438 4.16579,-4.0289 10.1314,-5.6576 14.53125,-9.5938 10.95554,-8.9754 22.80599,-13.3035 33.53072,-22.0995 39.63952,-34.98531 72.52538,-77.44861 115.01138,-108.86621 27.1658,-27.1851 73.7483,-29.6957 105.2079,-9.9093 -38.5642,15.0989 -76.7053,34.0757 -106.8125,63.0626 -14.44132,14.1099 -25.67127,31.1666 -41.00157,44.34981 -27.83085,25.7078 -59.41994,47.7547 -87.14345,73.7882 -10.93953,8.6869 -21.78724,19.5725 -36.13623,21.737 -3.34066,-0.5148 -3.8919,-4.876 -4,-7.625 z m 46.5625,-119.62501 c 22.70405,-21.5909 50.38139,-50.7056 73.18269,-75.6378 29.27789,-29.3129 70.25256,-45.6581 111.34856,-48.1748 -69.8759,37.1601 -125.08328,95.2166 -183.125,147.875 -2.5927,1.4466 -4.18548,5.1429 -6.5,6.09381 -3.85015,-6.47121 -14.90923,-2.75251 -12.16838,-12.04751 7.72595,-9.1768 8.72145,-9.6804 17.26213,-18.1087 z m 47.0625,173.21871 c 5.65384,-18.0865 23.88148,-27.6384 39.0283,-36.6769 14.48877,-7.725 29.21785,-15.8647 44.62795,-21.4168 41.7701,-7.1174 81.8242,-23.3848 124.0313,-27.4688 8.24292,-5.2561 18.71842,-2.277 27.93752,-4.0312 12.9401,1.81 22.7923,14.0649 25.3125,26.375 1.8666,8.7106 -5.8669,15.0906 -9.1875,22.375 -3.1785,5.8643 -9.27,9.4133 -12.125,15.6562 -7.5624,9.5248 -21.2509,11.6053 -32.37502,7.8438 -68.9423,-10.9185 -134.9538,26.0771 -203.8687,17.8875 -1.03704,-0.1301 -2.52876,-0.1786 -3.38135,-0.5438 z m 57.21875,142.5937 c 3.19719,4.7141 10.1509,1.2059 14.5313,0.25 25.2349,-7.9562 46.3117,-24.8088 69.6875,-36.6562 6.0021,-4.7061 9.8057,-11.88 15.5937,-16.5938 41.6227,-37.7701 -1.9826,-7.684 -5.5625,-5.3124 -29.3453,20.1735 -64.9496,43.6672 -97.73906,57.7584 -1.34286,0.8054 -3.82736,0.3071 3.48906,0.554 z m 9.4063,-301.12501 c 2.9517,-12.248 14.6204,-19.8059 24.3437,-26.7812 39.1056,-29.0647 83.8706,-49.7174 130.21882,-64.375 3.2991,-1.0193 4.715,-6.4291 0.3125,-6.9062 -16.18632,0.2742 -31.51682,-6.3232 -46.99342,-10.5666 -12.5995,-3.8598 -25.3787,-7.2494 -38.3504,-9.5897 27.409,-12.6065 53.7785,-27.7821 82.71882,-36.4375 32.7958,-7.1278 61.685,-30.0982 96.2761,-28.7116 5.3679,0.8275 12.3279,0.7562 16.2239,4.8991 7.8956,14.8889 6.4045,35.542 -7.25,46.625 -7.6915,6.4993 -16.9127,13.5471 -27.4688,12.4063 -9.652,0.1712 -18.222,5.6054 -27.5312,6.875 -8.5555,-0.693 -17.35,-0.5602 -25.125,3.1874 -4.0604,0.5121 -7.6805,6.1511 -3.625,8.875 8.5829,2.7079 17.498,-1.0547 25.9687,-2.375 11.9587,-2.8614 24.5906,-3.1425 36.1563,-7.4687 9.7775,-1.6041 18.6791,6.8446 22.4687,15.3125 6.1087,13.961 0.2248,29.2948 -6.75,41.7188 -2.3795,5.5312 -5.759,11.0276 -6.4375,17.0624 0.1702,2.4853 2.4385,4.2066 -0.25,6.2813 -11.7217,19.0379 -12.012,42.6672 -20.7812,62.90631 -5.2118,9.3721 -9.6151,21.0713 -21,24.5 -10.3313,3.7163 -21.8936,3.3116 -32.6563,2.8124 -9.9783,-3.0222 -20.357,-0.092 -29.92982,2.6446 -35.8164,2.9172 -71.5321,8.7921 -105.9764,19.168 -5.5724,1.151 -11.8254,-3.0262 -10.3125,-9.1876 1.0407,-16.964 12.1409,-32.1138 24.5,-42.9374 9.6915,-7.7455 22.7962,-7.6486 34,-12.3126 38.2838,-11.55131 76.18492,-24.58571 114.80022,-34.90591 13.9495,-1.8644 28.7272,-2.4934 41.0748,-10.2191 -35.3552,-8.5945 -71.6228,2.3986 -104.94872,13.9152 -28.7153,9.5981 -56.8053,22.0636 -86.7388,26.7411 -14.1843,1.4177 -29.5452,1.0039 -42.375,-5.5313 -2.4954,-1.8552 -4.5825,-4.4913 -4.5625,-7.625 z m 14.3125,-138.8437 c 8.5441,-11.8335 20.724,-20.6674 32.125,-29.7813 17.5733,-11.7737 35.2431,-23.701 51.5312,-37.375 27.6091,-21.7173 56.87452,-44.9657 92.84382,-50.1874 8.2799,-0.6819 18.1361,-4.5114 25.7187,0.1562 0.6018,5.7068 -5.5104,9.6405 -9.125,13.2188 -7.7767,6.6646 -17.6704,9.6781 -27.4504,11.2689 -31.1626,13.7503 -63.29002,25.6753 -93.75472,40.739 -25.7104,15.2293 -42.241,44.5011 -72.0449,52.7421 -0.8944,0.3432 -0.1021,-0.3894 0.1563,-0.7813 z m 52.7187,-17.4687 c 3.0193,-9.8668 13.2023,-14.9101 20.6602,-21.1713 21.6879,-14.6697 47.4261,-21.3365 71.33212,-31.6531 20.6595,-7.6531 40.8523,-16.8161 61.3515,-24.6132 11.2016,-3.9817 24.9102,-1.977 32.4687,7.5626 6.8554,6.9633 8.8591,20.895 -0.7187,26.4062 -10.6085,6.0155 -23.569,3.1361 -35.0216,6.9025 -46.4946,10.3523 -88.02182,39.9818 -136.66592,40.5975 -4.1533,-0.9841 -11.542,0.6773 -13.4063,-4.0312 z"
18 id="path2954-0"
19- inkscape:export-filename="/tmp/logo-128.png"
20- inkscape:export-xdpi="14.678443"
21- inkscape:export-ydpi="14.678443"
22+ inkscape:export-filename="/tmp/logo-016.png"
23+ inkscape:export-xdpi="1.84"
24+ inkscape:export-ydpi="1.84"
25 sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" />
26 <g
27 id="g2849"
28 style="fill:url(#linearGradient6008);fill-opacity:1"
29 transform="translate(-150.17112,121.46194)"
30- inkscape:export-filename="/tmp/logo-128.png"
31- inkscape:export-xdpi="14.678443"
32- inkscape:export-ydpi="14.678443">
33+ inkscape:export-filename="/tmp/logo-016.png"
34+ inkscape:export-xdpi="1.84"
35+ inkscape:export-ydpi="1.84">
36 <path
37 inkscape:export-ydpi="3.6700001"
38 inkscape:export-xdpi="3.6700001"
39@@ -625,6 +625,6 @@
40 sodipodi:cy="549.50507"
41 sodipodi:rx="230"
42 sodipodi:ry="225.71428"
43- d="m 694.28571,549.50507 a 230,225.71428 0 1 1 -460,0 230,225.71428 0 1 1 460,0 z" />
44+ d="m 694.28571,549.50507 c 0,124.65855 -102.97451,225.71428 -230,225.71428 -127.0255,0 -230,-101.05573 -230,-225.71428 0,-124.65856 102.9745,-225.71428 230,-225.71428 127.02549,0 230,101.05572 230,225.71428 z" />
45 </g>
46 </svg>
47
48=== removed file 'data/media/ubuntuone.png'
49Binary files data/media/ubuntuone.png 2010-04-25 16:57:37 +0000 and data/media/ubuntuone.png 1970-01-01 00:00:00 +0000 differ
50=== modified file 'data/ui/gui.glade'
51--- data/ui/gui.glade 2010-04-25 16:57:37 +0000
52+++ data/ui/gui.glade 2010-05-15 17:39:29 +0000
53@@ -232,6 +232,7 @@
54 <property name="has_tooltip">True</property>
55 <property name="tooltip_text">Magicicada</property>
56 <property name="title">Magicicada</property>
57+ <signal name="activate" handler="on_status_icon_activate"/>
58 </object>
59 <object class="GtkAboutDialog" id="about_dialog">
60 <property name="border_width">5</property>
61
62=== modified file 'magicicada/__init__.py'
63--- magicicada/__init__.py 2010-05-15 15:43:34 +0000
64+++ magicicada/__init__.py 2010-05-15 17:39:29 +0000
65@@ -68,7 +68,7 @@
66 for widget in widgets:
67 setattr(self, widget, self.builder.get_object(widget))
68
69- icon_filename = get_data_file('media', 'ubuntuone.png')
70+ icon_filename = get_data_file('media', 'logo-016.png')
71 self.status_icon.set_from_file(icon_filename)
72
73 self.main_window.set_icon_from_file(icon_filename)
74@@ -92,6 +92,7 @@
75 if self.started:
76 self.on_stop_clicked(self.stop)
77 self.syncdaemon.shutdown()
78+ self.shutdown()
79
80 def on_quit_activate(self, widget, data=None):
81 """Signal handler for closing the program."""
82@@ -102,7 +103,6 @@
83 response = self.about_dialog.run()
84 self.about_dialog.hide()
85
86- @print_debug
87 def on_start_clicked(self, widget, data=None):
88 """Start syncdaemon."""
89 self.started = True
90@@ -112,7 +112,6 @@
91
92 self.doing_something(self.is_started)
93
94- @print_debug
95 def on_stop_clicked(self, widget, data=None):
96 """Stop syncdaemon."""
97 assert self.started
98@@ -127,7 +126,6 @@
99
100 self.on_stopped()
101
102- @print_debug
103 def on_connect_clicked(self, widget, data=None):
104 """Connect syncdaemon."""
105 assert self.started
106@@ -138,7 +136,6 @@
107 self.on_started()
108 self.doing_something(self.is_connected)
109
110- @print_debug
111 def on_disconnect_clicked(self, widget, data=None):
112 """Disconnect syncdaemon."""
113 assert self.started
114@@ -149,6 +146,14 @@
115
116 self.on_disconnected()
117
118+ @print_debug
119+ def on_status_icon_activate(self, widget, data=None):
120+ """Systray icon was clicked."""
121+ if self.main_window.get_property('visible'):
122+ self.main_window.hide()
123+ else:
124+ self.main_window.show()
125+
126 # DBus callbacks
127
128 def on_started(self, *args, **kwargs):
129
130=== modified file 'magicicada/helpers.py'
131--- magicicada/helpers.py 2010-05-15 15:43:34 +0000
132+++ magicicada/helpers.py 2010-05-15 17:39:29 +0000
133@@ -9,8 +9,9 @@
134 'make_window',
135 ]
136
137+import gtk
138 import os
139-import gtk
140+import sys
141
142 from functools import wraps
143
144@@ -42,7 +43,8 @@
145 @wraps(f)
146 def inner(*args, **kwargs):
147 """Wrap f."""
148- print('Calling', f.__name__, args, kwargs)
149- f(*args, **kwargs)
150+ sys.stderr.write('Calling %s %s %s\n' % (f.__name__, args, kwargs))
151+ result = f(*args, **kwargs)
152+ return result
153
154 return inner
155
156=== added file 'magicicada/tests/__init__.py'
157--- magicicada/tests/__init__.py 1970-01-01 00:00:00 +0000
158+++ magicicada/tests/__init__.py 2010-05-15 17:39:29 +0000
159@@ -0,0 +1,19 @@
160+# __init__.py
161+#
162+# Author: Natalia Bidart <natalia.bidart@gmail.com>
163+#
164+# Copyright 2010 Chicharreros
165+#
166+# This program is free software: you can redistribute it and/or modify it
167+# under the terms of the GNU General Public License version 3, as published
168+# by the Free Software Foundation.
169+#
170+# This program is distributed in the hope that it will be useful, but
171+# WITHOUT ANY WARRANTY; without even the implied warranties of
172+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
173+# PURPOSE. See the GNU General Public License for more details.
174+#
175+# You should have received a copy of the GNU General Public License along
176+# with this program. If not, see <http://www.gnu.org/licenses/>.
177+
178+"""Magicicada Test Suite."""
179
180=== modified file 'magicicada/tests/test_magicicada.py'
181--- magicicada/tests/test_magicicada.py 2010-05-14 18:28:26 +0000
182+++ magicicada/tests/test_magicicada.py 2010-05-15 17:39:29 +0000
183@@ -72,14 +72,16 @@
184 self.patch(self.ui.syncdaemon, 'shutdown',
185 lambda *_: setattr(self, '_called', True))
186 self.ui.on_main_window_destroy(self.ui.main_window)
187- self.assertTrue(self._called, 'syncdaemon.shutdown must be called at destroy time.')
188+ self.assertTrue(self._called,
189+ 'syncdaemon.shutdown must be called at destroy time.')
190
191 def test_shutdown_stops_reactor(self):
192 """SyncDaemon instance is shutdown at destroy time."""
193 self.patch(reactor, 'stop',
194 lambda *_: setattr(self, '_called', True))
195 self.ui.shutdown()
196- self.assertTrue(self._called, 'reactor.stop must be called at destroy time.')
197+ self.assertTrue(self._called,
198+ 'reactor.stop must be called at destroy time.')
199
200
201 class MagicicadaUIStartupTestCase(MagicicadaUITestCase):
202@@ -115,7 +117,7 @@
203 self.assertFalse(self.ui.is_connected.is_sensitive())
204 self.assertFalse(self.ui.is_online.is_sensitive())
205
206-class MagicicadaUIClickedTestCase(MagicicadaUIStartupTestCase):
207+class MagicicadaUIClickedTestCase(MagicicadaUITestCase):
208 """UI test cases."""
209
210 def test_started_if_start_clicked(self):
211@@ -148,3 +150,18 @@
212 self.assertFalse(self.ui.connect.get_property('visible'))
213 self.assertTrue(self.ui.disconnect.get_property('visible'))
214
215+class MagicicadaUISystrayIconTestCase(MagicicadaUITestCase):
216+ """UI test cases for the systray icon."""
217+
218+ def test_main_window_is_hid_when_icon_clicked(self):
219+ """Main window is hid when the systray icon is clicked."""
220+ self.ui.on_status_icon_activate(self.ui.status_icon)
221+ self.assertFalse(self.ui.main_window.get_property('visible'),
222+ 'main_window should be invisible when icon clicked.')
223+
224+ def test_main_window_is_shown_when_clicked_after_hidden(self):
225+ """Main window is shown when the icon is clicked after hidden."""
226+ self.ui.on_status_icon_activate(self.ui.status_icon) # hide
227+ self.ui.on_status_icon_activate(self.ui.status_icon) # show
228+ msg = 'main_window should be visible when icon clicked after hidden.'
229+ self.assertTrue(self.ui.main_window.get_property('visible'), msg)

Subscribers

People subscribed via source and target branches

to all changes: