~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
18
18
import os
19
19
import warnings
20
20
 
21
21
from bzrlib import (
22
 
    bugtracker,
23
22
    revision,
24
23
    symbol_versioning,
25
24
    )
26
25
from bzrlib.branch import Branch
27
 
from bzrlib.errors import (
28
 
    InvalidBugStatus,
29
 
    InvalidLineInBugsProperty,
30
 
    NoSuchRevision,
31
 
    )
 
26
from bzrlib.errors import NoSuchRevision
32
27
from bzrlib.deprecated_graph import Graph
33
28
from bzrlib.revision import (find_present_ancestors,
34
29
                             NULL_REVISION)
 
30
from bzrlib.symbol_versioning import one_three
35
31
from bzrlib.tests import TestCase, TestCaseWithTransport
36
32
from bzrlib.trace import mutter
37
33
from bzrlib.workingtree import WorkingTree
235
231
        self.assertEqual(['B'], r.get_apparent_authors())
236
232
        r.properties['authors'] = 'C\nD'
237
233
        self.assertEqual(['C', 'D'], r.get_apparent_authors())
238
 
 
239
 
 
240
 
class TestRevisionBugs(TestCase):
241
 
    """Tests for getting the bugs that a revision is linked to."""
242
 
 
243
 
    def test_no_bugs(self):
244
 
        r = revision.Revision('1')
245
 
        self.assertEqual([], list(r.iter_bugs()))
246
 
 
247
 
    def test_some_bugs(self):
248
 
        r = revision.Revision(
249
 
            '1', properties={
250
 
                'bugs': bugtracker.encode_fixes_bug_urls(
251
 
                    ['http://example.com/bugs/1',
252
 
                     'http://launchpad.net/bugs/1234'])})
253
 
        self.assertEqual(
254
 
            [('http://example.com/bugs/1', bugtracker.FIXED),
255
 
             ('http://launchpad.net/bugs/1234', bugtracker.FIXED)],
256
 
            list(r.iter_bugs()))
257
 
 
258
 
    def test_no_status(self):
259
 
        r = revision.Revision(
260
 
            '1', properties={'bugs': 'http://example.com/bugs/1'})
261
 
        self.assertRaises(InvalidLineInBugsProperty, list, r.iter_bugs())
262
 
 
263
 
    def test_too_much_information(self):
264
 
        r = revision.Revision(
265
 
            '1', properties={'bugs': 'http://example.com/bugs/1 fixed bar'})
266
 
        self.assertRaises(InvalidLineInBugsProperty, list, r.iter_bugs())
267
 
 
268
 
    def test_invalid_status(self):
269
 
        r = revision.Revision(
270
 
            '1', properties={'bugs': 'http://example.com/bugs/1 faxed'})
271
 
        self.assertRaises(InvalidBugStatus, list, r.iter_bugs())