~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/whitebox.py

merge merge tweaks from aaron, which includes latest .dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/python
2
 
 
3
1
import os
4
2
import unittest
5
3
 
6
 
from bzrlib.selftest import InTempDir, TestCase
 
4
from bzrlib.selftest import TestCaseInTempDir, TestCase
7
5
from bzrlib.branch import ScratchBranch, Branch
8
6
from bzrlib.errors import NotBranchError, NotVersionedError
9
7
 
10
8
 
11
 
class TestBranch(InTempDir):
 
9
class TestBranch(TestCaseInTempDir):
12
10
 
13
11
    def test_unknowns(self):
14
 
        b = Branch('.', init=True)
 
12
        b = Branch.initialize('.')
15
13
 
16
14
        self.build_tree(['hello.txt',
17
15
                         'hello.txt~'])
22
20
    def test_no_changes(self):
23
21
        from bzrlib.errors import PointlessCommit
24
22
        
25
 
        b = Branch('.', init=True)
 
23
        b = Branch.initialize('.')
26
24
 
27
25
        self.build_tree(['hello.txt'])
28
26
 
72
70
                          'Martin Pool <mbp@sourcefrog.net>-20050311061123-96a255005c7c9dbe')
73
71
 
74
72
 
75
 
class PendingMerges(InTempDir):
 
73
class PendingMerges(TestCaseInTempDir):
76
74
 
77
75
    def test_pending_merges(self):
78
76
        """Tracking pending-merged revisions."""
79
 
        b = Branch('.', init=True)
 
77
        b = Branch.initialize('.')
80
78
 
81
79
        self.assertEquals(b.pending_merges(), [])
82
80
        b.add_pending_merge('foo@azkhazan-123123-abcabc')
99
97
        
100
98
    def test_revert(self):
101
99
        """Test selected-file revert"""
102
 
        b = Branch('.', init=True)
 
100
        b = Branch.initialize('.')
103
101
 
104
102
        self.build_tree(['hello.txt'])
105
103
        file('hello.txt', 'w').write('initial hello')
126
124
 
127
125
    def test_rename_dirs(self):
128
126
        """Test renaming directories and the files within them."""
129
 
        b = Branch('.', init=True)
 
127
        b = Branch.initialize('.')
130
128
        self.build_tree(['dir/', 'dir/sub/', 'dir/sub/file'])
131
129
        b.add(['dir', 'dir/sub', 'dir/sub/file'])
132
130