~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_weave.py

  • Committer: Alexander Belchenko
  • Date: 2006-07-31 16:12:57 UTC
  • mto: (1711.2.111 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1906.
  • Revision ID: bialix@ukr.net-20060731161257-91a231523255332c
new official bzr.ico

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
#! /usr/bin/python2.4
 
2
 
 
3
# Copyright (C) 2005 by Canonical Ltd
2
4
#
3
5
# This program is free software; you can redistribute it and/or modify
4
6
# it under the terms of the GNU General Public License as published by
23
25
 
24
26
from pprint import pformat
25
27
 
26
 
from bzrlib import (
27
 
    errors,
28
 
    )
29
 
from bzrlib.osutils import sha_string
30
 
from bzrlib.tests import TestCase, TestCaseInTempDir
 
28
import bzrlib.errors as errors
31
29
from bzrlib.weave import Weave, WeaveFormatError, WeaveError, reweave
32
30
from bzrlib.weavefile import write_weave, read_weave
 
31
from bzrlib.tests import TestCase
 
32
from bzrlib.osutils import sha_string
33
33
 
34
34
 
35
35
# texts for use in testing
890
890
        self.assertFalse(w1._compatible_parents(set(), set([1])))
891
891
        self.assertFalse(w1._compatible_parents(my_parents, set([1, 2, 3, 4])))
892
892
        self.assertFalse(w1._compatible_parents(my_parents, set([4])))
893
 
 
894
 
 
895
 
class TestWeaveFile(TestCaseInTempDir):
896
 
    
897
 
    def test_empty_file(self):
898
 
        f = open('empty.weave', 'wb+')
899
 
        try:
900
 
            self.assertRaises(errors.WeaveFormatError,
901
 
                              read_weave, f)
902
 
        finally:
903
 
            f.close()