def assert_equal_any_order(self, expected): actual_sorted = sorted(self.stream.getvalue().splitlines(1)) actual = "".join(actual_sorted) expected_sorted = sorted(expected.splitlines(1)) expected = "".join(expected_sorted) assert_equals_with_unidiff(expected, actual)
def should_be(self, expected): from assert_equals_with_unidiff import assert_equals_with_unidiff assert_equals_with_unidiff(expected, self.stream.getvalue())
def should_be(self, expected): assert_equals_with_unidiff(expected, self.output())
def should_be(self, expected): assert_equals_with_unidiff(expected, self.stream.getvalue())
def user_should_read_output(self, expected_output): assert_equals_with_unidiff(expected_output, self.user.actual_output())
def user_should_read_output_any_order(self, expected_output): actual_output = self.user.actual_output() assert_equals_with_unidiff(sort_lines(expected_output), sort_lines(actual_output))