Rev 2495: Add test for cat and missing. in file:///v/home/vila/src/experimental/reuse.transports/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Fri May 25 18:12:54 BST 2007
At file:///v/home/vila/src/experimental/reuse.transports/
------------------------------------------------------------
revno: 2495
revision-id: v.ladeuil+lp at free.fr-20070525171252-hsooebpkqtb3j6ef
parent: v.ladeuil+lp at free.fr-20070525163929-l6x2jv17ogc9q7s4
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: reuse.transports
timestamp: Fri 2007-05-25 19:12:52 +0200
message:
Add test for cat and missing.
* bzrlib/tests/commands/__init__.py:
(test_suite): Add test_cat and test_missing.
* bzrlib/tests/commands/test_cat.py:
New file.
* bzrlib/tests/commands/test_missing.py:
New file.
added:
bzrlib/tests/commands/test_cat.py test_cat.py-20070525170351-vg2apsfb5j413913-1
bzrlib/tests/commands/test_missing.py test_missing.py-20070525171057-qr1z4sleurlp9b5v-1
modified:
bzrlib/tests/commands/__init__.py __init__.py-20070520095518-ecfl8531fxgjeycj-1
-------------- next part --------------
=== added file 'bzrlib/tests/commands/test_cat.py'
--- a/bzrlib/tests/commands/test_cat.py 1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/commands/test_cat.py 2007-05-25 17:12:52 +0000
@@ -0,0 +1,32 @@
+# 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_cat
+from bzrlib.tests.TransportUtil import TestCaseWithConnectionHookedTransport
+
+class TestCat(TestCaseWithConnectionHookedTransport):
+
+ def test_cat(self):
+ wt1 = self.make_branch_and_tree('branch')
+ file('branch/foo', 'wb').write('foo')
+ wt1.add('foo')
+ wt1.commit('add foo')
+
+ cmd = cmd_cat()
+ cmd.run(self.get_url() + '/branch/foo')
+ self.assertEquals(1, len(self.connections))
+
=== added file 'bzrlib/tests/commands/test_missing.py'
--- a/bzrlib/tests/commands/test_missing.py 1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/commands/test_missing.py 2007-05-25 17:12:52 +0000
@@ -0,0 +1,36 @@
+# 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_missing
+from bzrlib.tests import StringIOWrapper
+from bzrlib.tests.TransportUtil import TestCaseWithConnectionHookedTransport
+
+class TestMissing(TestCaseWithConnectionHookedTransport):
+
+ def test_missing(self):
+ wt1 = self.make_branch_and_tree('.')
+ wt1.commit('empty commit')
+ wt2 = self.make_branch_and_tree('branch2')
+ wt2.pull(wt1.branch)
+ wt2.commit('empty commit too')
+
+ cmd = cmd_missing()
+ # We don't care about the ouput but 'outf' should be defined
+ cmd.outf = StringIOWrapper()
+ cmd.run(self.get_url() + '/branch2')
+ self.assertEquals(1, len(self.connections))
+
=== modified file 'bzrlib/tests/commands/__init__.py'
--- a/bzrlib/tests/commands/__init__.py 2007-05-25 16:39:29 +0000
+++ b/bzrlib/tests/commands/__init__.py 2007-05-25 17:12:52 +0000
@@ -29,10 +29,12 @@
def test_suite():
testmod_names = [
'bzrlib.tests.commands.test_branch',
+ 'bzrlib.tests.commands.test_cat',
'bzrlib.tests.commands.test_checkout',
'bzrlib.tests.commands.test_init',
'bzrlib.tests.commands.test_init_repository',
'bzrlib.tests.commands.test_merge',
+ 'bzrlib.tests.commands.test_missing',
'bzrlib.tests.commands.test_pull',
'bzrlib.tests.commands.test_push',
]
More information about the bazaar-commits
mailing list