Ejemplo n.º 1
0
 def test_project_and_repository_from_path(self, mock):
     with patch.object(git.Repo, "__init__", lambda p0, p1: None), \
             patch.object(CMakeProject, "__init__", lambda p0, p1: None):
         cycle = ReleaseCycle.from_path("/tmp/cmake_project", [MagicMock()])
         mock.assert_called_once_with("/tmp/cmake_project/CMakeLists.txt")
         self.assertIsInstance(cycle.project, CMakeProject)
         self.assertIsInstance(cycle.repository, git.Repo)
         self.assertEqual(1, cycle.number_of_steps())
Ejemplo n.º 2
0
def main():
    args = parse_args()
    new_version = args.release_version
    cycle = ReleaseCycle.from_path(
        args.path[0],
        [PreconditionStep(),
         UpdateVersionStep(),
         CommitAndTagStep()])
    cycle.create_release(new_version)
Ejemplo n.º 3
0
def main():
    args = parse_args()
    new_version = args.release_version

    try:
        cycle = ReleaseCycle.from_path(args.path, [
            PreconditionStep(),
            UpdateVersionStep(),
            CommitAndTagStep(args.message)
        ])
        cycle.create_release(new_version)
    except ReleaseException as ex:
        print(f"ERROR: {ex}")
        sys.exit(1)
Ejemplo n.º 4
0
 def test_from_path_throws_if_no_project_file(self, mock):
     with patch.object(git.Repo, "__init__", lambda p0, p1: None):
         with self.assertRaises(UnsupportedProjectException):
             ReleaseCycle.from_path("/tmp/cmake_project", [MagicMock()])
     mock.assert_called_once_with("/tmp/cmake_project/CMakeLists.txt")