@@ -1,60 +0,0 @@
1−From 4f45a37a390d7c844dd9c9b58fff7259a77ffff9 Mon Sep 17 00:00:00 2001
2−From: Javi Merino <merino.jav@gmail.com>
3−Date: Sun, 31 Aug 2014 05:45:17 -0700
4−Subject: [PATCH] Fix should_output_info_for_multiple_files
5−
6−Test should_output_info_for_multiple_files fails because the output is
7−not in the same order as the input. Add assert_equal_any_order() to
8−the OutputCollector, which sorts the expected and actual lines so that
9−the output matches even if the order in which they are shown in
10−trash-list is different.
11−---
12− integration_tests/describe_trash_list.py | 8 +++++---
13− integration_tests/output_collector.py | 8 ++++++++
14− 2 files changed, 13 insertions(+), 3 deletions(-)
15−
16−diff --git a/integration_tests/describe_trash_list.py b/integration_tests/describe_trash_list.py
17−index 6dd8d30..3489a22 100644
18−--- a/integration_tests/describe_trash_list.py
19−+++ b/integration_tests/describe_trash_list.py
20−@@ -73,9 +73,9 @@ def should_output_info_for_multiple_files(self):
21−
22− self.user.run_trash_list()
23−
24−- self.user.should_read_output( "2000-01-01 00:00:01 /file1\n"
25−- "2000-01-01 00:00:02 /file2\n"
26−- "2000-01-01 00:00:03 /file3\n")
27−+ self.user.should_read_output_any_order( "2000-01-01 00:00:01 /file1\n"
28−+ "2000-01-01 00:00:02 /file2\n"
29−+ "2000-01-01 00:00:03 /file3\n")
30−
31− @istest
32− def should_output_unknown_dates_with_question_marks(self):
33−@@ -294,6 +294,8 @@ def error(self):
34− raise ValueError()
35− def should_read_output(self, expected_value):
36− self.stdout.assert_equal_to(expected_value)
37−+ def should_read_output_any_order(self, expected_value):
38−+ self.stdout.assert_equal_any_order(expected_value)
39− def should_read_error(self, expected_value):
40− self.stderr.assert_equal_to(expected_value)
41− def output(self):
42−diff --git a/integration_tests/output_collector.py b/integration_tests/output_collector.py
43−index 06dc002..7f3704f 100644
44−--- a/integration_tests/output_collector.py
45−+++ b/integration_tests/output_collector.py
46−@@ -9,6 +9,14 @@ def write(self,data):
47− self.stream.write(data)
48− def assert_equal_to(self, expected):
49− return self.should_be(expected)
50−+ def assert_equal_any_order(self, expected):
51−+ actual_sorted = sorted(self.stream.getvalue().splitlines(1))
52−+ actual = "".join(actual_sorted)
53−+
54−+ expected_sorted = sorted(expected.splitlines(1))
55−+ expected = "".join(expected_sorted)
56−+
57−+ assert_equals_with_unidiff(expected, actual)
58− def should_be(self, expected):
59− assert_equals_with_unidiff(expected, self.stream.getvalue())
60− def should_match(self, regex):