1
from mago.test_suite.evolution import EvolutionTestSuite
2
from mago.application.evolution import Evolution, AccountInfo
3
from mago.check import ScreenshotCompare, FAIL
4
from mago.application.deskex import IndicatorApplet
6
from ConfigParser import ConfigParser
7
import ldtp, ooldtp, ldtputils
8
from time import sleep, time
9
from shutil import copytree, move
10
from os.path import expanduser
12
class EvolutionUseApp(Evolution):
13
def open(self, profile_template='', credentials='',
15
self.me_account = AccountInfo(me_account, credentials)
18
self.generate_profile(profile_template, self.me_account.template_args)
20
Evolution.open(self, False, credentials)
22
class EvolutionIndicatorTest(EvolutionTestSuite):
23
APPLICATION_FACTORY = EvolutionUseApp
27
def testIndicatorShowsUp(self):
28
indicator = IndicatorApplet()
29
if not indicator.is_server_shown("Evolution Mail"):
30
raise AssertionError("The indicator didn't show up", ldtputils.imagecapture())
32
def testIndicateMyself(self, subject, body, password=''):
34
indicator = IndicatorApplet()
35
no_message = indicator.capture_applet_icon()
36
email = self.application.me_account.template_args['emailaddress']
37
password = self.application.me_account.template_args['password']
39
self.application.compose_new_message(email, subject, body)
40
self.application.send_email(subject)
42
# Force sending the email
46
self.application.send_and_receive(password, True, True)
48
# Check that the applet icon changed
49
with_message = indicator.capture_applet_icon()
51
checker = ScreenshotCompare(no_message, with_message)
53
if checker.perform_test() != FAIL:
54
raise AssertionError('icon did not change.', ldtputils.imagecapture())