def test_run_task__path_not_found(self):
     project_config = BaseProjectConfig(BaseGlobalConfig())
     task_config = TaskConfig(
         {"options": {
             "path": "bogus",
             "revert_path": "bogus"
         }})
     task = CreateUnmanagedEESrc(project_config, task_config)
     with self.assertRaises(TaskOptionsError):
         task()
 def test_run_task__revert_path_already_exists(self):
     with temporary_dir() as path, temporary_dir() as revert_path:
         project_config = BaseProjectConfig(BaseGlobalConfig())
         task_config = TaskConfig(
             {"options": {
                 "path": path,
                 "revert_path": revert_path
             }})
         task = CreateUnmanagedEESrc(project_config, task_config)
         with self.assertRaises(TaskOptionsError):
             task()
 def test_run_task(self, removeXmlElement):
     with temporary_dir() as path:
         revert_path = os.path.join(os.path.dirname(path),
                                    os.path.basename(path) + "_revert")
         project_config = BaseProjectConfig(BaseGlobalConfig())
         task_config = TaskConfig(
             {"options": {
                 "path": path,
                 "revert_path": revert_path
             }})
         task = CreateUnmanagedEESrc(project_config, task_config)
         task()
         removeXmlElement.assert_called_once_with("availableFields", path,
                                                  "*.object")
Beispiel #4
0
 def test_run_task(self, removeXmlElement):
     with temporary_dir() as path:
         revert_path = os.path.join(os.path.dirname(path),
                                    os.path.basename(path) + "_revert")
         project_config = BaseProjectConfig(BaseGlobalConfig(),
                                            config={"noyaml": True})
         task_config = TaskConfig(
             {"options": {
                 "path": path,
                 "revert_path": revert_path
             }})
         task = CreateUnmanagedEESrc(project_config, task_config)
         task()
         removeXmlElement.assert_has_calls([
             mock.call("availableFields", path, "*.object"),
             mock.call("visibility[.='Protected']", path, "*.object"),
         ])