~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/blackbox.py

  • Committer: Aaron Bentley
  • Date: 2007-08-23 13:57:32 UTC
  • mfrom: (577.1.2 bzrtools)
  • Revision ID: abentley@panoramicfeedback.com-20070823135732-i86dvwgmgpm0vagh
MergeĀ fromĀ home

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
import os.path
 
3
from unittest import makeSuite
 
4
 
 
5
from bzrlib import branch
1
6
from bzrlib.tests import TestCaseWithTransport
2
 
from unittest import makeSuite
3
 
import os.path
 
7
 
 
8
 
4
9
class TestBzrTools(TestCaseWithTransport):
5
10
    @staticmethod
6
11
    def touch(filename):
160
165
        self.run_bzr('import source-0.1 import5')
161
166
        self.failUnlessExists('import5/src/myfile')
162
167
 
 
168
    def test_switch(self):
 
169
        tree = self.make_branch_and_tree('branch-1')
 
170
        self.build_tree(['branch-1/file-1'])
 
171
        tree.add('file-1')
 
172
        tree.commit('rev1')
 
173
        checkout = tree.branch.create_checkout('checkout', lightweight=True)
 
174
        self.build_tree(['branch-1/file-2'])
 
175
        tree.add('file-2')
 
176
        tree.remove('file-1')
 
177
        tree.commit('rev2')
 
178
        os.rename('branch-1', 'branch-2')
 
179
        to_branch = branch.Branch.open('branch-2')
 
180
        self.build_tree(['checkout/file-3'])
 
181
        checkout.add('file-3')
 
182
        self.run_bzr('switch ../branch-2', working_dir='checkout')
 
183
        self.failIfExists('checkout/file-1')
 
184
        self.failUnlessExists('checkout/file-2')
 
185
        self.failUnlessExists('checkout/file-3')
 
186
 
 
187
 
163
188
def test_suite():
164
189
    return makeSuite(TestBzrTools)