| 170 | self.steps = [] |
| 171 | |
| 172 | def test_start__stop(self): |
| 173 | x = self.Def(self) |
| 174 | x.create = Mock() |
| 175 | |
| 176 | # include creates the underlying object and sets |
| 177 | # its x.obj attribute to it, as well as appending |
| 178 | # it to the parent.steps list. |
| 179 | x.include(self) |
| 180 | assert self.steps |
| 181 | assert self.steps[0] is x |
| 182 | |
| 183 | x.start(self) |
| 184 | x.obj.start.assert_called_with() |
| 185 | |
| 186 | x.stop(self) |
| 187 | x.obj.stop.assert_called_with() |
| 188 | |
| 189 | x.obj = None |
| 190 | assert x.start(self) is None |
| 191 | |
| 192 | def test_terminate__no_obj(self): |
| 193 | x = self.Def(self) |