summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-04-28 14:20:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-04-28 14:20:13 +0200
commit63705994322a57eca5c9df5eb4a7e9ed5415ff4d (patch)
tree37ae1386ab3c2c3cec15f0d5bdd2d04376acb138
parent240383e171768e53a1b27144a9e054ced4d8da10 (diff)
downloadbzr-fastimport-63705994322a57eca5c9df5eb4a7e9ed5415ff4d.tar.gz
Add blackbox tests for 'bzr fast-import'.
-rw-r--r--cmds.py5
-rw-r--r--tests/test_commands.py14
2 files changed, 17 insertions, 2 deletions
diff --git a/cmds.py b/cmds.py
index eeb4a7f..e77c220 100644
--- a/cmds.py
+++ b/cmds.py
@@ -309,8 +309,9 @@ class cmd_fast_import(Command):
'import-marks': import_marks,
'export-marks': export_marks,
}
- return _run(source, generic_processor.GenericProcessor, control=control,
- params=params, verbose=verbose, user_map=user_map)
+ return _run(source, generic_processor.GenericProcessor,
+ control=control, params=params, verbose=verbose,
+ user_map=user_map)
def _generate_info(self, source):
from cStringIO import StringIO
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 67c47d0..f003f03 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -121,3 +121,17 @@ Head analysis:
\t[':1']\trefs/heads/master
Merges:
""")
+
+
+class TestFastImport(ExternalBase):
+
+ def test_empty(self):
+ self.build_tree_contents([('empty.fi', "")])
+ self.make_branch_and_tree("br")
+ self.assertEquals("", self.run_bzr("fast-import empty.fi br")[0])
+
+ def test_file(self):
+ tree = self.make_branch_and_tree("br")
+ self.build_tree_contents([('file.fi', simple_fast_import_stream)])
+ data = self.run_bzr("fast-import file.fi br")[0]
+ self.assertEquals(3, tree.branch.revno())