Skip to content

Commit

Permalink
ConsoleInteractorTest: Strip to 79 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
sils committed Apr 8, 2015
1 parent 7c81abd commit 5ec5529
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions coalib/tests/output/ConsoleInteractorTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def test_print_result(self):
with self.assertRaises(ValueError):
self.uut.print_result(PatchResult("origin",
"msg",
{testfile_path: diff}), file_dict)
{testfile_path: diff}),
file_dict)

# To assure user can rechose if he didn't chose wisely
input_generator = InputGenerator(["INVALID", -1, 1, 3])
Expand All @@ -120,18 +121,20 @@ def test_print_result(self):
# Check for asking the user for the paremeter just int the first time
# Use OpenEditorAction thats need parameter (editor command)
input_generator = InputGenerator([1, "test_editor", 1])
builtins.__dict__["input"] = input_generator.generate_input # Choose open editor action
# Choose open editor action
builtins.__dict__["input"] = input_generator.generate_input
PatchResult.get_actions = lambda self: [OpenEditorAction()]

patch_result = PatchResult("origin", "msg", {testfile_path: diff})
patch_result.file = "f_b"

self.uut.print_result(patch_result, file_dict)
self.assertEquals(input_generator.current_input, 1) # Increase by 2 (-1 -> 1)
# Increase by 2 (-1 -> 1)
self.assertEqual(input_generator.current_input, 1)

# Increase by 1, It shoudn't ask for parameter again
self.uut.print_result(patch_result, file_dict)
self.assertEquals(input_generator.current_input, 2)
self.assertEqual(input_generator.current_input, 2)

def test_static_functions(self):
q = queue.Queue()
Expand Down

1 comment on commit 5ec5529

@Makman2
Copy link
Member

@Makman2 Makman2 commented on 5ec5529 Apr 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Please sign in to comment.