1
# -*- coding: utf-8 -*-
3
from time import time, gmtime, strftime
5
from mago.test_suite.software_center import Software_centerTestSuite
7
class Software_center(Software_centerTestSuite):
8
def search_software(self, package, oracle):
9
""" Do a package search """
11
self.application.search_package(package)
12
content = self.application.getpackagelistrow(0)
14
if oracle not in content:
15
raise AssertionError("Package '%s' should be displayed on the first row" % package)
17
def install_software(self, package, oracle, password):
18
""" Install a package """
20
# TODO: Check if the package is already installed and cancel if it is
21
self.application.set_password(password)
22
self.application.install_or_remove_package("install", package)
24
# Check if the package has been correctly installed
25
content = self.application.getpackagelistrow(0)
26
if oracle not in content:
27
raise AssertionError("Package '%s' not installed" % package)
29
def remove_software(self, package, oracle, password):
30
""" Remove a package """
32
# TODO: Check if the package is not already installed and cancel if it is
33
self.application.set_password(password)
34
self.application.install_or_remove_package("remove", package)
36
# Check if the package has been correctly uninstalled
37
content = self.application.getpackagelistrow(0)
38
if oracle not in content:
39
raise AssertionError("Package '%s' not uninstalled" % package)
42
if __name__ == "__main__":
43
software_center_test = Software_center()
44
software_center_test.run()