def entry_point(): """ External entry point which calls main() and if Stop is raised, calls sys.exit() """ try: main("scc", items=[ (AlreadyMerged.NAME, AlreadyMerged), (CheckLabels.NAME, CheckLabels), (CheckMilestone.NAME, CheckMilestone), (CheckPRs.NAME, CheckPRs), (CheckStatus.NAME, CheckStatus), (Deploy.NAME, Deploy), (DeleteTags.NAME, DeleteTags), (Label.NAME, Label), (Merge.NAME, Merge), (MilestoneCommand.NAME, MilestoneCommand), (Rate.NAME, Rate), (Rebase.NAME, Rebase), (SetCommitStatus.NAME, SetCommitStatus), (Token.NAME, Token), (TagRelease.NAME, TagRelease), (TravisMerge.NAME, TravisMerge), (Version.NAME, Version), (UpdateSubmodules.NAME, UpdateSubmodules), ]) except Stop, stop: print stop, sys.exit(stop.rc)
def entry_point(): """ External entry point which calls main() and if Stop is raised, calls sys.exit() """ try: main("scc", items=[ (AlreadyMerged.NAME, AlreadyMerged), (CheckLabels.NAME, CheckLabels), (CheckMilestone.NAME, CheckMilestone), (CheckPRs.NAME, CheckPRs), (CheckStatus.NAME, CheckStatus), (Deploy.NAME, Deploy), (DeleteTags.NAME, DeleteTags), (Label.NAME, Label), (ExternalIssues.NAME, ExternalIssues), (Merge.NAME, Merge), (MilestoneCommand.NAME, MilestoneCommand), (Rate.NAME, Rate), (Rebase.NAME, Rebase), (SetCommitStatus.NAME, SetCommitStatus), (Token.NAME, Token), (TagRelease.NAME, TagRelease), (TravisMerge.NAME, TravisMerge), (Version.NAME, Version), (UnsubscribedRepos.NAME, UnsubscribedRepos), (UpdateSubmodules.NAME, UpdateSubmodules), ]) except Stop, stop: print stop, sys.exit(stop.rc)
def testVersionOverwrite(self, capsys): with open(version_file, 'w') as f: f.write('test\n') assert self.read_version_file() == 'test' try: main("test", ["version"], items=[("version", Version)]) out, err = capsys.readouterr() assert out.rstrip() == self.read_version_file() finally: os.remove(version_file)
def testNonGitRepository(self, capsys): # Move to a non-git repository and ensure call_git_describe # returns None dir = os.getcwd() os.chdir('..') try: assert call_git_describe() is None main("test", ["version"], items=[("version", Version)]) out, err = capsys.readouterr() assert out.rstrip() == self.read_version_file() except: os.chdir(dir)
def entry_point(): """ External entry point which calls main() and if Stop is raised, calls sys.exit() """ try: main("omego", items=[(InstallCommand.NAME, InstallCommand), (UpgradeCommand.NAME, UpgradeCommand), (ConvertCommand.NAME, ConvertCommand), (DownloadCommand.NAME, DownloadCommand), (DbCommand.NAME, DbCommand), (Version.NAME, Version)]) except Stop, stop: if stop.rc != 0: print "ERROR:", stop else: print stop sys.exit(stop.rc)
def entry_point(): """ External entry point which calls main() and if Stop is raised, calls sys.exit() """ try: main("omego", items=[ (InstallCommand.NAME, InstallCommand), (UpgradeCommand.NAME, UpgradeCommand), (ConvertCommand.NAME, ConvertCommand), (DownloadCommand.NAME, DownloadCommand), (DbCommand.NAME, DbCommand), (Version.NAME, OmegoVersion)]) except Stop, stop: if stop.rc != 0: print "ERROR:", stop else: print stop sys.exit(stop.rc)
def testGitRepository(self, tmpdir): cwd = os.getcwd() from subprocess import Popen, PIPE sandbox_url = "https://github.com/openmicroscopy/snoopys-sandbox.git" path = str(tmpdir.mkdir("sandbox")) # Read the version for the current Git repository main("test", ["version"], items=[("version", Version)]) version = self.read_version_file() try: # Clone snoopys-sanbox p = Popen(["git", "clone", sandbox_url, path], stdout=PIPE, stderr=PIPE) assert p.wait() == 0 os.chdir(path) # Check git describe returns a different version number assert call_git_describe() != version # Read the version again and check the file is unmodified main("test", ["version"], items=[("version", Version)]) assert self.read_version_file() == version finally: os.chdir(cwd)
def check_milestone(self, *args): args = ["check-milestone", "--no-ask"] + list(args) main("scc", args=args, items=[(CheckMilestone.NAME, CheckMilestone)])
def upgrade(self, *args): args = ["upgrade"] + list(args) main("omego", args=args, items=[("upgrade", UpgradeCommand)])
def update_submodules(self, *args): args = ["update-submodules", "--no-ask", self.branch] + list(args) main("scc", args=args, items=[(UpdateSubmodules.NAME, UpdateSubmodules)])
def download(self, *args): args = ["download", self.artifact] + list(args) main("omego", args=args, items=[("download", DownloadCommand)])
def testVersionOutput(self, capsys): main("test", ["version"], items=[("version", Version)]) out, err = capsys.readouterr() assert out.rstrip() == get_git_version(module_file)
def unrebased_prs(self): self.sandbox.checkout_branch("origin/" + self.branch1) self.args += [self.branch1, self.branch2] main("scc", args=self.args, items=[(CheckPRs.NAME, CheckPRs)])
def testVersionFile(self, capsys): main("test", ["version"], items=[("version", Version)]) assert os.path.isfile(version_file) out, err = capsys.readouterr() assert out.rstrip() == self.read_version_file()
def travis_merge(self, *args): self.sandbox.checkout_branch(self.branch[0]) args = ["travis-merge", "--no-ask"] + list(args) main("scc", args=args, items=[(TravisMerge.NAME, TravisMerge)])
def merge(self, *args): self.sandbox.checkout_branch(self.origin_remote + "/" + self.base) args = ["merge", "--no-ask", self.base] + list(args) main("scc", args=args, items=[(Merge.NAME, Merge)])
def rebase(self, *args): args = ["rebase", "--no-ask", str(self.pr.number), self.target_base] + list(args) main("scc", args=args, items=[(Rebase.NAME, Rebase)])
def deploy(self, tmpdir): args = ["deploy", str(tmpdir.join('test'))] main("scc", args=args, items=[("deploy", Deploy)])
def label(self, *args): args = ["label", "--no-ask"] + list(args) main("scc", args=args, items=[(Label.NAME, Label)])
def tag_release(self, *args): args = ["tag-release", "--no-ask"] + list(args) main("scc", args=args, items=[("tag-release", TagRelease)])
def testCallback(self, capsys): main("test", ["cb"], items=[("cb", CallbackCommand)]) out, err = capsys.readouterr() assert LISTENER.calls == set(["call", "cb"])