~ubuntu-branches/ubuntu/utopic/pida/utopic

« back to all changes in this revision

Viewing changes to pida/utils/testing.py

  • Committer: Bazaar Package Importer
  • Author(s): Jan Luebbe
  • Date: 2007-04-17 16:08:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070417160806-3ttlb6igf94x9i03
Tags: 0.4.4-1
* New upstream release (closes: #419129)
* Add dependency on python-glade2 (closes: #418716)
* Update copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import gtk
27
27
import sys
28
28
import os
 
29
import unittest
 
30
import gtk.gdk
 
31
from guitest.gtktest import GtkTestCase, guistate
 
32
from guitest.utils import mainloop_handler
29
33
 
30
34
os.environ['PIDA_HOME'] = '/tmp/pida-tests/'
31
35
 
121
125
    ServiceNotFoundError = ServiceNotFoundError
122
126
import pida.core.application as application
123
127
 
124
 
class FailedTest(Exception):
125
 
    pass
126
128
 
127
 
class ErrorTest(Exception):
128
 
    pass
 
129
def _setup(mod):
 
130
    mainloop = mainstop = lambda *a: None
 
131
    app = application.application()
 
132
    app.env.override_editor_option('Culebra')
 
133
    boss = MockBoss(app, app.env)
 
134
    base.set_boss(boss)
129
135
 
130
136
import nose
131
137
 
132
 
class ServiceTest(nose.TestCase):
 
138
class _ServiceTest(nose.TestCase):
133
139
    
134
140
    tested_service = 'terminal'
135
141
 
136
142
    def setUp(self):
137
 
        print 'setup'
138
143
        mainloop = mainstop = lambda *a: None
139
144
        self.app = application.main(MockBoss, mainloop, mainstop)
140
145
        self.boss = self.app.boss
150
155
        self.assert_((sname, name) in self.boss.commands)
151
156
        self.assert_(len(self.boss.commands[(sname, name)]) == times)
152
157
 
153
 
    def test_execute(self):
154
 
        ts = self.get_test_service()
155
 
        ts.call('execute_shell')
156
 
        self.assert_called('window', 'append_page')
 
158
    #def test_execute(self):
 
159
    #    ts = self.get_test_service()
 
160
    #    ts.call('execute_shell')
 
161
    #    self.assert_called('window', 'append_page')
157
162
 
158
163
        
159
164