(self, event_loop, fake_event_svc, ability, executor)
| 76 | mock_emit_status_change_method.assert_called_with(from_status=-3, to_status=-5) |
| 77 | |
| 78 | def test_emit_status_change_event(self, event_loop, fake_event_svc, ability, executor): |
| 79 | executor = executor('psh', 'windows') |
| 80 | ability = ability(executor=executor) |
| 81 | link = Link(command='net user a', paw='123456', ability=ability, executor=executor, status=-3) |
| 82 | fake_event_svc.reset() |
| 83 | |
| 84 | event_loop.run_until_complete( |
| 85 | link._emit_status_change_event( |
| 86 | from_status=-3, |
| 87 | to_status=-5 |
| 88 | ) |
| 89 | ) |
| 90 | |
| 91 | expected_key = (Link.EVENT_EXCHANGE, Link.EVENT_QUEUE_STATUS_CHANGED) |
| 92 | assert expected_key in fake_event_svc.fired |
| 93 | |
| 94 | event_kwargs = fake_event_svc.fired[expected_key] |
| 95 | assert event_kwargs['link'] == link.id |
| 96 | assert event_kwargs['from_status'] == -3 |
| 97 | assert event_kwargs['to_status'] == -5 |
| 98 | |
| 99 | def test_link_agent_reported_time_not_present_when_none_roundtrip(self, ability, executor): |
| 100 | test_executor = executor(name='psh', platform='windows') |
nothing calls this directly
no test coverage detected