From 3c0694f81ea16170064aea55cc66260c5ca36281 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Sat, 20 Apr 2013 19:00:12 +1200 Subject: Teach load how to cause a failure in response to stdin. --- testrepository/tests/commands/test_load.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testrepository/tests') diff --git a/testrepository/tests/commands/test_load.py b/testrepository/tests/commands/test_load.py index ed564c8..d3a0cbc 100644 --- a/testrepository/tests/commands/test_load.py +++ b/testrepository/tests/commands/test_load.py @@ -224,6 +224,19 @@ class TestCommandLoad(ResourcedTestCase): self.assertEqual(0, cmd.execute()) self.assertEqual([], ui.outputs) + def test_load_abort_over_interactive_stream(self): + ui = UI([('subunit', b''), ('interactive', b'a\n')]) + cmd = load.load(ui) + ui.set_command(cmd) + cmd.repository_factory = memory.RepositoryFactory() + cmd.repository_factory.initialise(ui.here) + self.assertEqual(1, cmd.execute()) + self.assertEqual( + [('results', Wildcard), + ('summary', False, 1, None, None, None, + [('id', 0, None), ('failures', 1, None)])], + ui.outputs) + def test_partial_passed_to_repo(self): ui = UI([('subunit', _b(''))], [('quiet', True), ('partial', True)]) cmd = load.load(ui) -- cgit v1.2.1