~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_treebuilder.py

  • Committer: Martin Pool
  • Date: 2007-07-13 04:22:17 UTC
  • mto: This revision was merged to the branch mainline in revision 2618.
  • Revision ID: mbp@sourcefrog.net-20070713042217-mnkwb9przs8x2de0
Move bencode tests from within their module into our test suite

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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
"""Tests for the TreeBuilder helper class."""
19
19
 
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()
49
49
 
50
50
 
51
51
class TestTreeBuilderMemoryTree(tests.TestCaseWithMemoryTransport):
52
 
 
 
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)