| 71 | class test_Pidbox_green: |
| 72 | |
| 73 | def test_stop(self): |
| 74 | parent = Mock() |
| 75 | g = gPidbox(parent) |
| 76 | stopped = g._node_stopped = Mock() |
| 77 | shutdown = g._node_shutdown = Mock() |
| 78 | close_chan = g._close_channel = Mock() |
| 79 | |
| 80 | g.stop(parent) |
| 81 | shutdown.set.assert_called_with() |
| 82 | stopped.wait.assert_called_with() |
| 83 | close_chan.assert_called_with(parent) |
| 84 | assert g._node_stopped is None |
| 85 | assert g._node_shutdown is None |
| 86 | |
| 87 | close_chan.reset() |
| 88 | g.stop(parent) |
| 89 | close_chan.assert_called_with(parent) |
| 90 | |
| 91 | def test_resets(self): |
| 92 | parent = Mock() |