~ubuntu-branches/ubuntu/vivid/mago/vivid

« back to all changes in this revision

Viewing changes to software_center/software_center.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-02-08 13:32:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110208133213-m1og7ey0m990chg6
Tags: 0.3+bzr20-0ubuntu1
* debian/rules:
  - updated to debhelper 7
  - use dh_python2 instead of python-central
* debian/pycompat:
  - removed, no longer needed
* debian/control:
  - dropped cdbs and python-central dependencies
* bzr snapshot of the current trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
import os
3
 
from time import time, gmtime, strftime
4
 
 
5
 
from mago.test_suite.software_center import Software_centerTestSuite 
6
 
 
7
 
class Software_center(Software_centerTestSuite):
8
 
    def search_software(self, package, oracle):
9
 
        """ Do a package search """
10
 
 
11
 
        self.application.search_package(package)
12
 
        content = self.application.getpackagelistrow(0)
13
 
 
14
 
        if oracle not in content:
15
 
            raise AssertionError("Package '%s' should be displayed on the first row" % package)
16
 
 
17
 
    def install_software(self, package, oracle, password):
18
 
        """ Install a package """
19
 
 
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)
23
 
 
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)
28
 
 
29
 
    def remove_software(self, package, oracle, password):
30
 
        """ Remove a package """
31
 
 
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)
35
 
 
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)
40
 
 
41
 
 
42
 
if __name__ == "__main__":
43
 
    software_center_test =  Software_center()
44
 
    software_center_test.run()