~mpt/software-center/help-3.0

« back to all changes in this revision

Viewing changes to test/test_gui_buy_something.py

  • Committer: Michael Vogt
  • Date: 2010-09-06 15:48:09 UTC
  • Revision ID: michael.vogt@ubuntu.com-20100906154809-ylptkufg3ill96l3
make sure there is always a toplevel transaction for a pending
purchase even if s-c waits for the for-pay repository to become
available (LP: #627608)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
            if os.path.exists(p):
30
30
                os.remove(p)
31
31
            subprocess.call(["dpkg", "-r", "hellox", "hello"])
 
32
        # get the software from staging
 
33
        os.environ["SOFTWARE_CENTER_BUY_HOST"]="https://sc.staging.ubuntu.com"
 
34
        os.environ["PYTHONPATH="]=os.path.abspath("..")
 
35
        if os.getuid() == 0:
 
36
            cmd = ["sudo", "-E", "-u", os.environ["SUDO_USER"]]
 
37
        else:
 
38
            cmd = []
 
39
        cmd += ["/usr/share/software-center/update-software-center-agent"]
 
40
        res = subprocess.call(cmd, env=os.environ)
 
41
        print cmd, res
 
42
 
32
43
        apt.apt_pkg.config.set("Dir::log::history", "/tmp")
33
44
        apt.apt_pkg.config.set("Dir::state::lists", "/tmp")
34
45
        # mock options
62
73
 
63
74
    def test_buy_something_gui(self):
64
75
        # assert we find the right package
65
 
        model = self._run_search("fluendo-dvd")
 
76
        model = self._run_search("hellox")
66
77
        treeview = self.app.available_pane.app_view
67
 
        self.assertFirstPkgInModel(model, "fluendo-dvd")
 
78
        self.assertFirstPkgInModel(model, "hellox")
68
79
        treeview.row_activated(model.get_path(model.get_iter_root()),
69
80
                               treeview.get_column(0))
70
81
        self._p()