~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/whitebox.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-27 04:42:41 UTC
  • mfrom: (1092.1.43)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050827044241-23d676133b9fc981
Merge of robertc@robertcollins.net-20050826013321-52eee1f1da679ee9

Show diffs side-by-side

added added

removed removed

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