~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_treebuilder.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-22 14:32:48 UTC
  • mto: (4471.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4472.
  • Revision ID: v.ladeuil+lp@free.fr-20090622143248-pe4av866hxgzn60e
Use the same method or function names for _dirstate_helpers in pyrex and
python modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
"""Tests for the TreeBuilder helper class."""
19
19
 
20
 
from bzrlib import errors
 
20
from bzrlib import errors, tests
21
21
from bzrlib.memorytree import MemoryTree
22
22
from bzrlib.tests import TestCaseWithTransport
23
23
from bzrlib.treebuilder import TreeBuilder
37
37
 
38
38
 
39
39
class TestFakeTree(TestCaseWithTransport):
40
 
    
 
40
 
41
41
    def testFakeTree(self):
42
42
        """Check that FakeTree works as required for the TreeBuilder tests."""
43
43
        tree = FakeTree()
48
48
        self.assertEqual(["lock_tree_write", "unlock"], tree._calls)
49
49
 
50
50
 
51
 
class TestTreeBuilder(TestCaseWithTransport):
52
 
    
 
51
class TestTreeBuilderMemoryTree(tests.TestCaseWithMemoryTransport):
 
52
 
53
53
    def test_create(self):
54
54
        builder = TreeBuilder()
55
55
 
64
64
        tree = FakeTree()
65
65
        builder.start_tree(tree)
66
66
        self.assertRaises(errors.AlreadyBuilding, builder.start_tree, tree)
67
 
        
 
67
 
68
68
    def test_finish_tree_not_started_errors(self):
69
69
        builder = TreeBuilder()
70
70
        self.assertRaises(errors.NotBuilding, builder.finish_tree)
92
92
        self.assertEqual('contents of bar/file\n',
93
93
            tree.get_file(tree.path2id('bar/file')).read())
94
94
        builder.finish_tree()
 
95