~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_info.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
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
25
25
    errors,
26
26
    info,
27
27
    osutils,
28
 
    tests,
29
28
    upgrade,
30
29
    urlutils,
31
30
    )
32
 
from bzrlib.transport import memory
33
 
 
34
 
 
35
 
class TestInfo(tests.TestCaseWithTransport):
 
31
from bzrlib.osutils import format_date
 
32
from bzrlib.tests import TestSkipped, MemoryServer
 
33
from bzrlib.tests.blackbox import ExternalBase
 
34
 
 
35
 
 
36
class TestInfo(ExternalBase):
36
37
 
37
38
    def setUp(self):
38
 
        super(TestInfo, self).setUp()
 
39
        ExternalBase.setUp(self)
39
40
        self._repo_strings = "2a"
40
41
 
41
42
    def test_info_non_existing(self):
42
 
        self.vfs_transport_factory = memory.MemoryServer
 
43
        self.vfs_transport_factory = MemoryServer
43
44
        location = self.get_url()
44
45
        out, err = self.run_bzr('info '+location, retcode=3)
45
46
        self.assertEqual(out, '')
126
127
        self.assertEqual('', err)
127
128
        tree1.commit('commit one')
128
129
        rev = branch1.repository.get_revision(branch1.revision_history()[0])
129
 
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
 
130
        datestring_first = format_date(rev.timestamp, rev.timezone)
130
131
 
131
132
        # Branch standalone with push location
132
133
        branch2 = branch1.bzrdir.sprout('branch').open_branch()
314
315
        tree1.add('b')
315
316
        tree1.commit('commit two')
316
317
        rev = branch1.repository.get_revision(branch1.revision_history()[-1])
317
 
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
 
318
        datestring_last = format_date(rev.timestamp, rev.timezone)
318
319
 
319
320
        # Out of date branched standalone branch will not be detected
320
321
        out, err = self.run_bzr('info -v branch')
568
569
        tree2.add('a')
569
570
        tree2.commit('commit one')
570
571
        rev = repo.get_revision(branch2.revision_history()[0])
571
 
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
 
572
        datestring_first = format_date(rev.timestamp, rev.timezone)
572
573
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
573
574
        self.assertEqualDiff(
574
575
"""Lightweight checkout (format: %s)
687
688
 
688
689
        # Out of date lightweight checkout
689
690
        rev = repo.get_revision(branch1.revision_history()[-1])
690
 
        datestring_last = osutils.format_date(rev.timestamp, rev.timezone)
 
691
        datestring_last = format_date(rev.timestamp, rev.timezone)
691
692
        out, err = self.run_bzr('info tree/lightcheckout --verbose')
692
693
        self.assertEqualDiff(
693
694
"""Lightweight checkout (format: %s)
843
844
        tree1.add('a')
844
845
        tree1.commit('commit one')
845
846
        rev = repo.get_revision(branch1.revision_history()[0])
846
 
        datestring_first = osutils.format_date(rev.timestamp, rev.timezone)
 
847
        datestring_first = format_date(rev.timestamp, rev.timezone)
847
848
        out, err = self.run_bzr('info -v repo/branch1')
848
849
        self.assertEqualDiff(
849
850
"""Repository tree (format: knit)