Lines Matching refs:cmd

40         def check_attributes(cmd, func, args, subdir=None, debug=None,  argument
43 self.assertEquals(cmd.func, func)
44 self.assertEquals(cmd.args, args)
45 self.assertEquals(cmd.subdir, subdir)
46 self.assertEquals(cmd.debug, debug)
47 self.assertEquals(cmd.pid, pid)
48 self.assertEquals(cmd.returncode, returncode)
49 self.assertEquals(cmd.fork_hooks, fork_hooks)
50 self.assertEquals(cmd.join_hooks, join_hooks)
55 cmd = subcommand.subcommand(func, (2, 3))
56 check_attributes(cmd, func, (2, 3))
71 cmd = subcommand.subcommand(func, (2, 3), subdir='dir')
72 check_attributes(cmd, func, (2, 3), subdir='/foo/dir',
82 cmd = _create_subcommand(func, [])
83 cmd.fork_start()
85 return cmd
89 cmd = self._setup_fork_start_parent()
91 self.assertEquals(cmd.pid, 1000)
113 cmd = _create_subcommand(func, (1, 2))
118 fork_hook.expect_call(cmd)
124 join_hook.expect_call(cmd)
127 cmd.fork_start()
136 cmd = _create_subcommand(func, (1, 2))
150 cmd.fork_start()
155 cmd = self._setup_fork_start_parent()
157 return cmd
161 cmd = self._setup_poll()
165 self.assertEquals(cmd.poll(), None)
170 cmd = self._setup_poll()
174 self.assertEquals(cmd.poll(), 0)
179 cmd = self._setup_poll()
180 self.god.stub_function(cmd, '_handle_exitstatus')
184 cmd._handle_exitstatus.expect_call(10).and_raises(Exception('fail'))
186 self.assertRaises(Exception, cmd.poll)
191 cmd = self._setup_poll()
196 self.assertEquals(cmd.wait(), 0)
201 cmd = self._setup_poll()
202 self.god.stub_function(cmd, '_handle_exitstatus')
207 cmd._handle_exitstatus.expect_call(10).and_raises(Exception('fail'))
208 self.assertRaises(Exception, cmd.wait)
217 cmd = subcommand.subcommand(func, args)
218 cmd.fork_start()
219 return cmd
224 cmd = self._setup_subcommand(lambda: None)
225 self.assertEquals(cmd.fork_waitfor(), 0)
230 cmd = self._setup_subcommand(lambda: None)
231 self.assertEquals(cmd.fork_waitfor(timeout=60), 0)
236 cmd = self._setup_subcommand(lambda: None, 'foo')
238 cmd.fork_waitfor(timeout=60)
243 cmd = self._setup_subcommand(lambda: time.sleep(60))
245 cmd.fork_waitfor(timeout=1)
259 cmd = _create_subcommand(func, args)
260 cmd.result_pickle = self.god.create_mock_class(file, 'file')
261 return self.god.create_mock_class(cmd, 'subcommand')
401 cmd = object()
402 cmds.append(cmd)
405 .and_return(cmd))