~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisiontree.py

  • Committer: Matthew Revell
  • Date: 2008-03-05 14:11:35 UTC
  • mto: This revision was merged to the branch mainline in revision 3263.
  • Revision ID: matthew.revell@canonical.com-20080305141135-96jf8j24b9crru6v
Added an admin-guide directory to doc/en and outlined headings for the admin guide in index.txt

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 RevisionTree class."""
19
19
 
20
20
from bzrlib import (
21
 
    errors,
22
21
    revision,
23
22
    )
24
23
import bzrlib
25
 
from bzrlib.inventory import ROOT_ID
26
24
from bzrlib.tests import TestCaseWithTransport
 
25
from bzrlib.tree import RevisionTree
27
26
 
28
27
 
29
28
class TestTreeWithCommits(TestCaseWithTransport):
52
51
            self.t.branch.repository.revision_tree(revid_2).get_parent_ids())
53
52
        # TODO commit a merge and check it is reported correctly.
54
53
 
55
 
        # the parents for a revision_tree(NULL_REVISION) are []:
 
54
        # the parents for a revision_tree(None) are []:
56
55
        self.assertEqual([],
57
 
            self.t.branch.repository.revision_tree(
58
 
                revision.NULL_REVISION).get_parent_ids())
 
56
            self.t.branch.repository.revision_tree(None).get_parent_ids())
59
57
 
60
58
    def test_empty_no_root(self):
61
59
        null_tree = self.t.branch.repository.revision_tree(
62
60
            revision.NULL_REVISION)
63
61
        self.assertIs(None, null_tree.inventory.root)
64
 
 
65
 
    def test_get_file_mtime_ghost(self):
66
 
        file_id = iter(self.rev_tree).next()
67
 
        self.rev_tree.inventory[file_id].revision = 'ghostrev'
68
 
        self.assertRaises(errors.FileTimestampUnavailable, 
69
 
            self.rev_tree.get_file_mtime, file_id)