Merge lp://qastaging/~tealeg/landscape-client/mocker-replace-test-fs into lp://qastaging/~landscape/landscape-client/trunk

Proposed by Geoff Teale
Status: Merged
Approved by: Geoff Teale
Approved revision: 847
Merged at revision: 850
Proposed branch: lp://qastaging/~tealeg/landscape-client/mocker-replace-test-fs
Merge into: lp://qastaging/~landscape/landscape-client/trunk
Diff against target: 51 lines (+14/-11)
1 file modified
landscape/lib/tests/test_fs.py (+14/-11)
To merge this branch: bzr merge lp://qastaging/~tealeg/landscape-client/mocker-replace-test-fs
Reviewer Review Type Date Requested Status
🤖 Landscape Builder test results Approve
Geoff Teale (community) Approve
Chad Smith Approve
Данило Шеган (community) Approve
Review via email: mp+297486@code.qastaging.launchpad.net

Commit message

Replace use of the mocker library with the new python mock library.

Description of the change

Replace use of the mocker library with the new python mock library.

Note the use of the "with patch.object(...) as blah:" idiom. It's a little non-obvious but the variable created are in the scope of the function, and persist even after the with context is ended (no new scope is created, afterall).

Testing instructions:

trial landscape.lib.tests.test_fs

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

Looks good, fails as expected when I comment out the os.utime call.

review: Approve
Revision history for this message
Chad Smith (chad.smith) wrote :

+1 with inline comments. We should use assert_called_once_with where applicable.

review: Approve
Revision history for this message
Geoff Teale (tealeg) wrote :

Approving to please tarmac.

review: Approve
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :
Download full text (178.9 KiB)

The attempt to merge lp:~tealeg/landscape-client/mocker-replace-test-fs into lp:landscape-client failed. Below is the output from the failed tests.

python setup.py build_ext -i
running build_ext
landscape.broker.tests.test_amp
  RemoteBrokerTest
    test_call_if_accepted ... [OK]
    test_call_if_accepted_with_not_accepted ... [OK]
    test_call_on_events ... [OK]
    test_exit ... [OK]
    test_fire_event ... [OK]
    test_get_accepted_message_types ... [OK]
    test_get_server_uuid ... [OK]
    test_is_message_pending ... [OK]
    test_listen_events ... [OK]
    test_method_call_error ... [OK]
    test_ping ... [OK]
    test_register ... [OK]
    test_register_client ... [OK]
    test_register_client_accepted_message_type ... [OK]
    test_reload_configuration ... [OK]
    test_send_message ... [OK]
    test_send_message_with_urgent ... [OK]
    test_stop_clients ... [OK]
  RemoteClientTest
    test_exit ... [OK]
    test_fire_event ... [OK]
    test_message ... [OK]
    test_method_call_error ... [OK]
    test_ping ... [OK]
landscape.broker.tests.test_client
  BrokerClientTest
    test_add ... [OK]
    test_dispatch_message ... [OK]
    test_dispatch_message_with_exception ... [OK]
    test_dispatch_message_with_no_handler ... [OK]
    test_exchange ... [OK]
    test_exchange_logs_errors_and_continues ... [OK]
    test_exchange_on_plugin_without_exchange_method ... [OK]
    test_exit ... [OK]
    test_fire_event ... [OK]
    test_fire_event_with_acceptance_changed ... [OK]
    test_fire_event_with_arguments ... [OK]
    test_fire_event_with_mixed_results ... [OK]
    test_get_named_plugin ... [OK]
...

Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make check
Result: Success
Revno: 847
Branch: lp:~tealeg/landscape-client/mocker-replace-test-fs
Jenkins: https://ci.lscape.net/job/latch-test/5034/

review: Approve (test results)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

No approved revision specified.

Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: make check
Result: Success
Revno: 847
Branch: lp:~tealeg/landscape-client/mocker-replace-test-fs
Jenkins: https://ci.lscape.net/job/latch-test/5035/

review: Approve (test results)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: