コード例 #1
0
 def _PopTask(self, tasks):
     """Remove the first event from the task list and save new list to disk."""
     tasks.pop(0)
     try:
         files.Dump(self._task_list_path, tasks, mode='w')
         if not tasks:
             files.Remove(self._task_list_path)
     except files.Error as e:
         raise ConfigRunnerError(e)
コード例 #2
0
ファイル: files_test.py プロジェクト: wutijat/glazier
 def testRemoveWithoutBackup(self, remove):
     files.Remove('/test/file/name.yaml', backup=False)
     remove.assert_called_with('/test/file/name.yaml')
     # error handling
     remove.side_effect = file_util.Error('test error')
     self.assertRaises(files.Error,
                       files.Remove,
                       '/test/file/name.yaml',
                       backup=False)
コード例 #3
0
ファイル: files_test.py プロジェクト: wutijat/glazier
 def testRemoveWithBackup(self, move):
     files.Remove('/test/file/name.yaml', backup=True)
     move.assert_called_with('/test/file/name.yaml',
                             '/test/file/name.yaml.bak')
     # error handling
     move.side_effect = file_util.Error('test error')
     self.assertRaises(files.Error,
                       files.Remove,
                       '/test/file/name.yaml',
                       backup=True)