~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_whitebox.py

  • Committer: Robert Collins
  • Date: 2005-11-28 05:13:41 UTC
  • mfrom: (1185.33.54 merge-recovered)
  • Revision ID: robertc@robertcollins.net-20051128051341-059936f2f29a12c8
Merge from Martin. Adjust check to work with HTTP again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import os
2
2
import unittest
3
3
 
4
 
from bzrlib.selftest import TestCaseInTempDir, TestCase
 
4
from bzrlib.tests import TestCaseInTempDir, TestCase
5
5
from bzrlib.branch import ScratchBranch, Branch
6
6
from bzrlib.errors import NotBranchError
7
7
 
8
8
 
9
9
class TestBranch(TestCaseInTempDir):
10
10
 
11
 
    def test_unknowns(self):
12
 
        b = Branch.initialize('.')
13
 
 
14
 
        self.build_tree(['hello.txt',
15
 
                         'hello.txt~'])
16
 
 
17
 
        self.assertEquals(list(b.unknowns()),
18
 
                          ['hello.txt'])
19
 
 
20
11
    def test_no_changes(self):
21
12
        from bzrlib.errors import PointlessCommit
22
13
        
32
23
        b.working_tree().commit('commit pointless tree',
33
24
                 allow_pointless=True)
34
25
 
35
 
        b.add('hello.txt')
 
26
        b.working_tree().add('hello.txt')
36
27
        
37
28
        b.working_tree().commit('commit first added file',
38
29
                 allow_pointless=False)
52
43
        """Test renaming directories and the files within them."""
53
44
        b = Branch.initialize('.')
54
45
        self.build_tree(['dir/', 'dir/sub/', 'dir/sub/file'])
55
 
        b.add(['dir', 'dir/sub', 'dir/sub/file'])
 
46
        b.working_tree().add(['dir', 'dir/sub', 'dir/sub/file'])
56
47
 
57
48
        b.working_tree().commit('create initial state')
58
49
 
68
59
        self.check_inventory_shape(inv,
69
60
                                   ['dir', 'dir/sub', 'dir/sub/file'])
70
61
 
71
 
        b.rename_one('dir', 'newdir')
 
62
        b.working_tree().rename_one('dir', 'newdir')
72
63
 
73
64
        self.check_inventory_shape(b.working_tree().read_working_inventory(),
74
65
                                   ['newdir', 'newdir/sub', 'newdir/sub/file'])
75
66
 
76
 
        b.rename_one('newdir/sub', 'newdir/newsub')
 
67
        b.working_tree().rename_one('newdir/sub', 'newdir/newsub')
77
68
        self.check_inventory_shape(b.working_tree().read_working_inventory(),
78
69
                                   ['newdir', 'newdir/newsub',
79
70
                                    'newdir/newsub/file'])