예제 #1
0
 def test_semver_make_valid(self):
     tests = [('simple-1.0.0', SemanticVersion('simple', 1, 0, 0)),
              ('another-10.11.12', SemanticVersion('another', 10, 11, 12))]
     for tag, expect in tests:
         semver = SemanticVersion.make(tag)
         self.assertEquals(semver, expect)
         self.assertEquals(tag, semver.to_tag())
         self.assertEquals(tag[tag.rfind('-') + 1:], semver.to_version())
예제 #2
0
    def test_maybe_pull_repository_branch(self):
        test_root = os.path.join(self.base_temp_dir, 'pulled_test')
        git = self.git
        scm = SpinnakerSourceCodeManager(git, test_root,
                                         self.TEST_SOURCE_REPOSITORIES)

        for repository in self.TEST_SOURCE_REPOSITORIES.values():
            scm.maybe_pull_repository_source(repository,
                                             git_branch=UNTAGGED_BRANCH)
            git_dir = scm.get_local_repository_path(repository.name)

            remote_git = git.determine_remote_git_repository(git_dir)
            self.assertEquals(repository, remote_git)

            in_branch = git.query_local_repository_branch(git_dir)
            self.assertEquals(UNTAGGED_BRANCH, in_branch)

            summary = git.collect_repository_summary(git_dir)
            semver = SemanticVersion.make(BASE_VERSION)
            expect_version = semver.next(
                SemanticVersion.MINOR_INDEX).to_version()

            self.assertEquals(expect_version, summary.version)