Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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()
Exemplo n.º 3
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())
         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")
Exemplo n.º 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"),
         ])