/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_commit.py

  • Committer: Curtis Hovey
  • Date: 2012-02-04 14:05:59 UTC
  • mfrom: (772.2.5 handle-patch)
  • Revision ID: sinzui.is@verizon.net-20120204140559-307aeiy47rieqxsf
Merged bzr-handle-patch gtk3 fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Test the Commit functionality."""
18
18
 
19
19
import os
 
20
import subprocess
 
21
from tempfile import NamedTemporaryFile
20
22
 
21
23
from gi.repository import Gtk
22
24
 
1296
1298
        self.assertEquals(u'', self._get_commit_message())
1297
1299
        self.assertEquals(u'de',
1298
1300
                          self._get_file_commit_messages())
 
1301
 
 
1302
 
 
1303
class BzrHandlePatchTestCase(tests.TestCase):
 
1304
 
 
1305
    def setUp(self):
 
1306
        top = os.path.abspath(os.path.join(
 
1307
            os.path.dirname(__file__), os.pardir))
 
1308
        self.script = os.path.join(top, 'bzr-handle-patch')
 
1309
        self.env = dict(os.environ)
 
1310
        self.env['BZR_PLUGINS_AT'] = 'gtk@%s' % top
 
1311
        self.patch = NamedTemporaryFile()
 
1312
        self.patch.write('\n'.join([
 
1313
            "=== added file '_test.txt'",
 
1314
            "--- _test.txt      1970-01-01 00:00:00 +0000",
 
1315
            "+++ _test.txt      2012-02-03 20:00:34 +0000",
 
1316
            "@@ -0,0 +1,1 @@",
 
1317
            "+hello",
 
1318
            ]))
 
1319
        self.patch.flush()
 
1320
        super(BzrHandlePatchTestCase, self).setUp()
 
1321
 
 
1322
    def test_smoketest(self):
 
1323
        # This is a smoke test to verify the process starts.
 
1324
        bzr_notify = subprocess.Popen(
 
1325
            [self.script, self.patch.name, 'test'],
 
1326
            stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=self.env)
 
1327
        stdout, stderr = bzr_notify.communicate()
 
1328
        self.assertEqual('', stdout)
 
1329
        self.assertEqual('', stderr)