def test_blank_output(self, mocked_check_output): key, cmd = 'dummy', 'echo dummy' args = next( template_args.ExternalCmdGenerator(key, cmd).gen_args(), None) self.assertIsNone(args) mocked_check_output.assert_called_once_with('echo dummy', shell=True, stderr=-2)
def test_key_cmd_in_init(self, mocked_check_output): key, cmd = 'dummy', 'echo dummy' args = next( template_args.ExternalCmdGenerator(key, cmd).gen_args(), None) self.assertIsInstance(args, tuple) k, v = args self.assertEqual(k, 'dummy') self.assertEqual(v, 'dummy') mocked_check_output.assert_called_once_with('echo dummy', shell=True)