Rev 2492: Add test for pull. in file:///v/home/vila/src/experimental/reuse.transports/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri May 25 16:11:07 BST 2007


At file:///v/home/vila/src/experimental/reuse.transports/

------------------------------------------------------------
revno: 2492
revision-id: v.ladeuil+lp at free.fr-20070525151105-iabak02mwjjxrxty
parent: v.ladeuil+lp at free.fr-20070525144142-wp4vof8hjjn3g9zx
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: reuse.transports
timestamp: Fri 2007-05-25 17:11:05 +0200
message:
  Add test for pull.
  
  * bzrlib/tests/commands/__init__.py:
  (test_suite): Add test_pull.
  
  * bzrlib/tests/commands/test_pull.py: 
  New file.
added:
  bzrlib/tests/commands/test_pull.py test_pull.py-20070525144918-cgmunk4ici2krjnd-1
modified:
  bzrlib/tests/commands/__init__.py __init__.py-20070520095518-ecfl8531fxgjeycj-1
  bzrlib/tests/commands/test_branch.py test_branch.py-20070520173042-ou3a796w3xn1y8ps-1
-------------- next part --------------
=== added file 'bzrlib/tests/commands/test_pull.py'
--- a/bzrlib/tests/commands/test_pull.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/commands/test_pull.py	2007-05-25 15:11:05 +0000
@@ -0,0 +1,34 @@
+# Copyright (C) 2007 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+from bzrlib.builtins import cmd_pull
+from bzrlib.tests import StringIOWrapper
+from bzrlib.tests.TransportUtil import TestCaseWithConnectionHookedTransport
+
+class TestPull(TestCaseWithConnectionHookedTransport):
+
+    def test_pull(self):
+        wt1 = self.make_branch_and_tree('branch1')
+        tip = wt1.commit('empty commit')
+        wt2 = self.make_branch_and_tree('branch2')
+
+        cmd = cmd_pull()
+        # We don't care about the ouput but 'outf' should be defined
+        cmd.outf = StringIOWrapper()
+        cmd.run(self.get_url() + '/branch1', directory='branch2')
+        self.assertEquals(1, len(self.connections))
+

=== modified file 'bzrlib/tests/commands/__init__.py'
--- a/bzrlib/tests/commands/__init__.py	2007-05-25 14:41:42 +0000
+++ b/bzrlib/tests/commands/__init__.py	2007-05-25 15:11:05 +0000
@@ -30,6 +30,7 @@
     testmod_names = [
         'bzrlib.tests.commands.test_branch',
         'bzrlib.tests.commands.test_init',
+        'bzrlib.tests.commands.test_pull',
         'bzrlib.tests.commands.test_push',
         ]
     loader = TestLoader()

=== modified file 'bzrlib/tests/commands/test_branch.py'
--- a/bzrlib/tests/commands/test_branch.py	2007-05-25 14:41:42 +0000
+++ b/bzrlib/tests/commands/test_branch.py	2007-05-25 15:11:05 +0000
@@ -34,6 +34,7 @@
         cmd.run('branch', self.get_url() + '/remote')
         self.assertEquals(1, len(self.connections))
 
+    # This is bug 112173 too
     def test_branch_remote_remote(self):
         self.make_branch_and_tree('branch')
         cmd = cmd_branch()



More information about the bazaar-commits mailing list