/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_diff.py

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 16:20:15 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629162015-amhe7xj4cdmup4id
Rename GtkProgressBarStack to GtkWindowProgressBarStack

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from cStringIO import StringIO
19
19
import os
20
20
 
21
 
from bzrlib import (
22
 
    conflicts,
23
 
    errors,
24
 
    tests,
25
 
    )
 
21
from bzrlib import errors, tests
26
22
from bzrlib.merge_directive import MergeDirective2
27
23
 
28
24
from bzrlib.plugins.gtk.diff import (
102
98
 
103
99
 
104
100
class MockWindow(object):
105
 
 
106
101
    def __init__(self):
107
102
        self.diff = MockDiffWidget()
108
103
        self.merge_successful = False
308
303
            [('a-id', 'a', 'removed', 'a'),
309
304
             ('b-id', 'b', 'removed', 'b/'),
310
305
            ], tree)
311
 
 
312
 
    def test_status_missing_file(self):
313
 
        this = self.make_branch_and_tree('this')
314
 
        self.build_tree(['this/foo'])
315
 
        this.add(['foo'], ['foo-id'])
316
 
        this.commit('add')
317
 
 
318
 
        other = this.bzrdir.sprout('other').open_workingtree()
319
 
 
320
 
        os.remove('this/foo')
321
 
        this.remove('foo', force=True)
322
 
        this.commit('remove')
323
 
 
324
 
        f = open('other/foo', 'wt')
325
 
        try:
326
 
            f.write('Modified\n')
327
 
        finally:
328
 
            f.close()
329
 
        other.commit('modified')
330
 
 
331
 
        this.merge_from_branch(other.branch)
332
 
        conflicts.resolve(this)
333
 
 
334
 
        self.assertStatusEqual(
335
 
            [('foo-id', 'foo.OTHER', 'missing', 'foo.OTHER'),],
336
 
            this)
337
 
 
338
 
    def test_status_missing_directory(self):
339
 
        this = self.make_branch_and_tree('this')
340
 
        self.build_tree(['this/foo/', 'this/foo/bar'])
341
 
        this.add(['foo', 'foo/bar'], ['foo-id', 'bar-id'])
342
 
        this.commit('add')
343
 
 
344
 
        other = this.bzrdir.sprout('other').open_workingtree()
345
 
 
346
 
        os.remove('this/foo/bar')
347
 
        os.rmdir('this/foo')
348
 
        this.remove('foo', force=True)
349
 
        this.commit('remove')
350
 
 
351
 
        f = open('other/foo/bar', 'wt')
352
 
        try:
353
 
            f.write('Modified\n')
354
 
        finally:
355
 
            f.close()
356
 
        other.commit('modified')
357
 
 
358
 
        this.merge_from_branch(other.branch)
359
 
        conflicts.resolve(this)
360
 
 
361
 
        self.assertStatusEqual(
362
 
            [('foo-id', u'foo', 'added', u'foo/'),
363
 
             ('bar-id', u'foo/bar.OTHER', 'missing', u'foo/bar.OTHER'),],
364
 
            this)