Chromium Code Reviews| Index: testing_support/tests/auto_stub_test.py |
| diff --git a/testing_support/tests/auto_stub_test.py b/testing_support/tests/auto_stub_test.py |
| index 3322da9524bd4efa17da8008bfb80d265e1885df..d459831a01de5ebb91c956656b78b1671aad4502 100644 |
| --- a/testing_support/tests/auto_stub_test.py |
| +++ b/testing_support/tests/auto_stub_test.py |
| @@ -21,13 +21,14 @@ class TestSimpleMock(unittest.TestCase): |
| def test_auto_mock_sorted(self): |
| obj = MockedObject(self) |
| + # Regardless of order here, ... |
| obj.method1(1, c=4, a=2, b=3) |
| - # tandrii@ is very surprised this is actually deterministic. |
| - obj.check_calls(['method1(1, a=2, c=4, b=3)']) |
| - # The proper and sane way is to always sort them. |
| - obj = MockedObject(self, sorted_kwargs=True) |
| - obj.method1(1, c=4, a=2, b=3) |
| - obj.check_calls(['method1(1, a=2, b=3, c=4)']) |
| + obj.method1(1, a=2, c=4, b=3) |
| + # ... order here is sorted and hence totally deterministic. |
| + obj.check_calls([ |
| + 'method1(1, a=2, b=3, c=4)', |
| + auto_stub.format_call('method1', 1, b=3, c=4, a=2), |
|
Sergiy Byelozyorov
2016/07/28 13:01:36
nice that you also randomize the order here
|
| + ]) |
| def return_one(): |