~ubuntu-branches/ubuntu/raring/bzr-svn/raring

« back to all changes in this revision

Viewing changes to tests/test_changes.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-07-30 23:14:36 UTC
  • mfrom: (1.1.28 upstream) (3.3.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100730231436-po8j0ibgjn2d6hy0
Tags: 1.0.3-1
* New upstream release.
 + Provides BranchConfig._get_change_editor. Closes: #572109
 + Supports more trunk layout levels. Closes: #573988
* Bump standards version to 3.9.1.
* Mark as supporting bzr 2.2.
* Suggest bzr-rewrite rather than bzr-rebase. LP: #481730

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2005-2009 Jelmer Vernooij <jelmer@samba.org>
2
 
 
 
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
15
15
 
16
16
"""Tests for the changes module."""
17
17
 
 
18
from subvertpy import NODE_DIR
 
19
 
18
20
from bzrlib.tests import TestCase
19
21
 
20
22
from bzrlib.plugins.svn.changes import (
90
92
class ApplyReverseChangesTests(TestCase):
91
93
 
92
94
    def test_parent_rename(self):
93
 
        self.assertEquals([('tags/2.5-M2', 'geotools/tags/2.5-M2', 5617)],
94
 
            list(apply_reverse_changes(['trunk/geotools2', 'tags/2.5-M2', 'trunk'], 
95
 
                {'tags': (u'A', 'geotools/tags', 5617), 'geotools/tags': (u'D', None, -1)}))
 
95
        self.assertEquals([('tags/2.5-M2', 'geotools/tags/2.5-M2', 5617, NODE_DIR)],
 
96
            list(apply_reverse_changes(['trunk/geotools2', 'tags/2.5-M2', 'trunk'],
 
97
                {'tags': (u'A', 'geotools/tags', 5617, NODE_DIR), 'geotools/tags': (u'D', None, -1, NODE_DIR)}))
96
98
            )
97
99
 
98
100
    def test_simple_rename(self):
99
 
        self.assertEquals([("newname", "oldname", 2)],
100
 
            list(apply_reverse_changes(["newname"], 
101
 
                {"newname": (u"A", "oldname", 2)})))
 
101
        self.assertEquals([("newname", "oldname", 2, NODE_DIR)],
 
102
            list(apply_reverse_changes(["newname"],
 
103
                {"newname": (u"A", "oldname", 2, NODE_DIR)})))
102
104
 
103
105
    def test_simple_rename_nonexistant(self):
104
106
        self.assertEquals([],
105
 
            list(apply_reverse_changes([], 
106
 
                {"newname": (u"A", "oldname", 2)})))
 
107
            list(apply_reverse_changes([],
 
108
                {"newname": (u"A", "oldname", 2, NODE_DIR)})))
107
109
 
108
110
    def test_modify(self):
109
111
        self.assertEquals([],
110
 
            list(apply_reverse_changes(["somename"], 
111
 
                {"somename": (u"M", None, -1)})))
 
112
            list(apply_reverse_changes(["somename"],
 
113
                {"somename": (u"M", None, -1, NODE_DIR)})))
112
114
 
113
115
    def test_delete(self):
114
 
        self.assertEquals([("somename/bloe", None, -1)],
115
 
            list(apply_reverse_changes(["somename/bloe"], 
116
 
                {"somename": (u"D", None, -1)})))
 
116
        self.assertEquals([("somename/bloe", None, -1, NODE_DIR)],
 
117
            list(apply_reverse_changes(["somename/bloe"],
 
118
                {"somename": (u"D", None, -1, NODE_DIR)})))
117
119
 
118
120
    def test_add(self):
119
121
        self.assertEquals([],
120
 
            list(apply_reverse_changes(["somename"], 
121
 
                {"somename": (u"A", None, -1)})))
 
122
            list(apply_reverse_changes(["somename"],
 
123
                {"somename": (u"A", None, -1, NODE_DIR)})))
122
124
 
123
125
    def test_chaco(self):
124
 
        self.assertEquals([('packages/enthought-chaco2/trunk', 'packages/chaco2/trunk', 3)],
 
126
        self.assertEquals([('packages/enthought-chaco2/trunk', 'packages/chaco2/trunk', 3, NODE_DIR)],
125
127
            list(apply_reverse_changes(['packages/enthought-chaco2/trunk'],
126
 
                { "packages/chaco2": ("D", None, -1),
127
 
                    "packages/enthought-chaco2": ("A", "packages/chaco2", 3),
128
 
                    "packages/enthought-chaco2/trunk": ("D", None, -1)})))
 
128
                { "packages/chaco2": ("D", None, -1, NODE_DIR),
 
129
                    "packages/enthought-chaco2": ("A", "packages/chaco2", 3, NODE_DIR),
 
130
                    "packages/enthought-chaco2/trunk": ("D", None, -1, NODE_DIR)})))