コード例 #1
0
 def test_m_flow(self, read_config_mock, get_branch_mock):
     get_branch_mock.return_value = Good('master')
     config = copy(self.base_config)
     config.workflow = Workflow.m_flow
     read_config_mock.return_value = Good(config)
     res = assert_branch('release', 'm')
     self.assert_ok(res)
     res = assert_branch('hotfix', 'm')
     self.assert_ok(res)
     # different master branch
     config.m_flow = MFlowConfig('prod')
     get_branch_mock.return_value = Good('prod')
     res = assert_branch('release', 'm')
     self.assert_ok(res)
コード例 #2
0
 def test_invalid_flow(self, read_config_mock, get_branch_mock):
     config = copy(self.base_config)
     config.workflow = cast(Workflow, 'oops')
     get_branch_mock.return_value = Good('master')
     read_config_mock.return_value = Good(config)
     res = assert_branch('release', 'm')
     self.assert_issue(res, 'invalid m workflow')
コード例 #3
0
 def test_free_flow(self, read_config_mock, get_branch_mock):
     get_branch_mock.return_value = Good('master')
     read_config_mock.return_value = Good(self.base_config)
     res = assert_branch('release', 'm')
     self.assert_issue(
         res,
         'The free-flow workflow does not support releases',
     )
コード例 #4
0
 def test_m_flow_error(self, read_config_mock, get_branch_mock):
     get_branch_mock.return_value = Good('topic/active-branch')
     config = copy(self.base_config)
     config.workflow = Workflow.m_flow
     read_config_mock.return_value = Good(config)
     res = assert_branch('release', 'm')
     self.assert_issue(
         res,
         "invalid branch for 'release' using m_flow",
     )