def test_version(self): ''' Test for return rsync version ''' mock = MagicMock(side_effect=[OSError(1, 'f'), 'A B C\n']) with patch.dict(rsync.__salt__, {'cmd.run_stdout': mock}): self.assertRaises(CommandExecutionError, rsync.version) self.assertEqual(rsync.version(), 'C')
def test_version(self): ''' Test for return rsync version ''' mock = MagicMock(side_effect=[IOError('f'), 'A B C\n']) with patch.dict(rsync.__salt__, {'cmd.run_stdout': mock}): self.assertRaises(CommandExecutionError, rsync.version) self.assertEqual(rsync.version(), 'C')
def test_version(self): """ Test for return rsync version """ mock = MagicMock(side_effect=[OSError(1, "f"), "A B C\n"]) with patch.dict(rsync.__salt__, {"cmd.run_stdout": mock}): self.assertRaises(CommandExecutionError, rsync.version) self.assertEqual(rsync.version(), "C")