~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2008-08-25 21:50:11 UTC
  • mfrom: (0.11.3 tools)
  • mto: This revision was merged to the branch mainline in revision 3659.
  • Revision ID: john@arbash-meinel.com-20080825215011-de9esmzgkue3e522
Merge in Lukáš's helper scripts.
Update the packaging documents to describe how to do the releases
using bzr-builddeb to package all distro platforms
simultaneously.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import sys
22
22
 
23
23
from bzrlib.branch import Branch
 
24
from bzrlib.directory_service import directories
24
25
from bzrlib.osutils import pathjoin
25
26
from bzrlib.tests.blackbox import ExternalBase
26
27
from bzrlib.uncommit import uncommit
305
306
        self.assertContainsRe(out, 'bar')
306
307
        self.assertNotContainsRe(out, 'added:')
307
308
        self.assertNotContainsRe(out, 'foo')
 
309
 
 
310
    def test_pull_quiet(self):
 
311
        """Check that bzr pull --quiet does not print anything"""
 
312
        tree_a = self.make_branch_and_tree('tree_a')
 
313
        self.build_tree(['tree_a/foo'])
 
314
        tree_a.add('foo')
 
315
        revision_id = tree_a.commit('bar')
 
316
        tree_b = tree_a.bzrdir.sprout('tree_b').open_workingtree()
 
317
        out, err = self.run_bzr('pull --quiet -d tree_b')
 
318
        self.assertEqual(out, '')
 
319
        self.assertEqual(err, '')
 
320
        self.assertEqual(tree_b.last_revision(), revision_id)
 
321
        self.build_tree(['tree_a/moo'])
 
322
        tree_a.add('moo')
 
323
        revision_id = tree_a.commit('quack')
 
324
        out, err = self.run_bzr('pull --quiet -d tree_b')
 
325
        self.assertEqual(out, '')
 
326
        self.assertEqual(err, '')
 
327
        self.assertEqual(tree_b.last_revision(), revision_id)
 
328
 
 
329
    def test_pull_from_directory_service(self):
 
330
        source = self.make_branch_and_tree('source')
 
331
        source.commit('commit 1')
 
332
        target = source.bzrdir.sprout('target').open_workingtree()
 
333
        source_last = source.commit('commit 2')
 
334
        class FooService(object):
 
335
            """A directory service that always returns source"""
 
336
 
 
337
            def look_up(self, name, url):
 
338
                return 'source'
 
339
        directories.register('foo:', FooService, 'Testing directory service')
 
340
        self.addCleanup(lambda: directories.remove('foo:'))
 
341
        self.run_bzr('pull foo:bar -d target')
 
342
        self.assertEqual(source_last, target.last_revision())