Example #1
0
 def test_version(self):
     fix_version = jira_adapter.get_next_release_name_in_project("HOSTDEV")
     key = jissue(["create", "task", "this is a test", "--fix-version=0.16", "HOSTDEV"])
     issue = jira_adapter.get_issue(key)
     self.assertEquals(jira_adapter.issue_mappings['FixVersions'](issue), ["0.16"])
     self.assertEquals(jira_adapter.issue_mappings['Type'](issue), "Task")
     jira_adapter.resolve_issue(key, 'Not a Bug', fix_version)
Example #2
0
 def test_component__jish(self):
     fix_version = jira_adapter.get_next_release_name_in_project("HOSTDEV")
     key = jissue(["create", "Bug", "this is a test"], dict(JISSUE_COMPONENT="integration-tests",
                                                            JISSUE_PROJECT="HOSTDEV"))
     issue = jira_adapter.get_issue(key)
     self.assertEquals(jira_adapter.issue_mappings['Components'](issue), ["integration-tests"])
     jira_adapter.resolve_issue(key, 'Not a Bug', fix_version)
Example #3
0
 def test_description(self):
     fix_version = jira_adapter.get_next_release_name_in_project("HOSTDEV")
     summary, description = "summary goes here", "description goes here"
     key = jissue(["create", "bug", "{}\n{}".format(summary, description), "HOSTDEV"])
     issue = jira_adapter.get_issue(key)
     self.assertEquals(description, issue.fields().description)
     jira_adapter.resolve_issue(key, 'Not a Bug', fix_version)
Example #4
0
 def test_jish_and_file(self):
     with unstaged_files_context():
         execute_assert_success(["git", "add", "foo"])
         with open("foo", "w"):
             pass
         self.assertEquals(jissue(["commit", "just a message", "--file=foo"], dict(JISSUE_ISSUE="HOSTDEV-955")), 0)
         self.assertIn("just a message", execute_assert_success("git log", shell=True).get_stdout())
Example #5
0
 def test_jish_and_short(self):
     fix_version = jira_adapter.get_next_release_name_in_project("HOSTDEV")
     with mock_stdout() as stdout:
         key = jissue(["create", "bug", "this is a test", "--short"], dict(JISSUE_PROJECT="HOSTDEV",
                                                                           JISSUE_COMPONENT="jissue",
                                                                           JISSUE_VERSION=fix_version))
     self.assertEquals(key, stdout.getvalue().strip())
     jira_adapter.resolve_issue(key, 'Not a Bug', fix_version)
Example #6
0
 def test_simple(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["link", "relates", "HOSTDEV-787", issue.key]), 0)
Example #7
0
 def test_jish(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["label", "--label=test"], dict(JISSUE_ISSUE=issue.key)), 0)
Example #8
0
 def test_jish(self, key="HOSTDEV-787"):
     self.assertEquals(jissue(["show"], dict(JISSUE_ISSUE=key)), 0)
Example #9
0
 def test_component(self):
     fix_version = jira_adapter.get_next_release_name_in_project("HOSTDEV")
     key = jissue(["create", "Bug", "this is a test", "--component=integration-tests", "HOSTDEV"])
     issue = jira_adapter.get_issue(key)
     self.assertEquals(jira_adapter.issue_mappings['Components'](issue), ["integration-tests"])
     jira_adapter.resolve_issue(key, 'Not a Bug', fix_version)
Example #10
0
 def test_additional_flags(self, flag):
     self.assertEquals(jissue(["search", self.query, flag]), 0)
Example #11
0
 def test_jish(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["assign", "--to-me", issue.key]), 0)
         self.assertEquals(jissue(["start"], dict(JISSUE_ISSUE=issue.key)), 0)
         self.assertEquals(jissue(["stop"], dict(JISSUE_ISSUE=issue.key)), 0)
Example #12
0
 def test_automatic(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["assign", "--automatic", issue.key]), 0)
Example #13
0
 def test_jish(self):
     self.assertEquals(jissue(["inventory"], dict(JISSUE_PROJECT="HOSTDEV")), 0)
Example #14
0
 def test_simple(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["label", "--label=test", "--label=anothe-test", issue.key]), 0)
Example #15
0
 def test_simple(self):
     with unstaged_files_context():
         execute_assert_success(["git", "add", "foo"])
         self.assertEquals(jissue(["commit", "just a message", "HOSTDEV-955"]), 0)
         self.assertIn("just a message", execute_assert_success("git log", shell=True).get_stdout())
Example #16
0
 def test_jish(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["comment", "just a comment"], dict(JISSUE_ISSUE=issue.key)), 0)
         with mock_stdout() as stdout:
             jissue(["show", issue.key])
         self.assertIn("just a comment", stdout.getvalue())
Example #17
0
 def test_simple(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["comment", "just a comment", issue.key]), 0)
         with mock_stdout() as stdout:
             jissue(["show", issue.key])
         self.assertIn("just a comment", stdout.getvalue())
Example #18
0
 def test_requires_key(self):
     self.assertEquals(jissue(["list"]), 1)
Example #19
0
 def test_jish(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["assign", "--assignee=guyr"], dict(JISSUE_ISSUE=issue.key)), 0)
Example #20
0
 def test_additional_flags(self, flag):
     self.assertEquals(jissue(["list", "HOSTDEV", flag]), 0)
Example #21
0
 def test_simple(self):
     self.assertEquals(jissue(["inventory", "HOSTDEV"]), 0)
Example #22
0
 def test_commit_fails(self):
     with unstaged_files_context():
         with mock_stderr() as stderr:
             self.assertEquals(jissue(["commit", "just a message", "HOSTDEV-955"]), 1)
             self.assertNotEquals(stderr.getvalue(), '')
Example #23
0
 def test_simple(self):
     self.assertEquals(jissue(["search", self.query]), 0)
Example #24
0
 def test_jish(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["resolve"], dict(JISSUE_ISSUE=issue.key)), 0)
         raise SkipResolve()
Example #25
0
 def test_simple(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["assign", "--to-me", issue.key]), 0)
         self.assertEquals(jissue(["start", issue.key]), 0)
         self.assertEquals(jissue(["stop", issue.key]), 0)
Example #26
0
 def test_simple(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["resolve", issue.key, "--fix-version", "0.16"]), 0)
         raise SkipResolve()
Example #27
0
 def test_simple(self, key):
     self.assertEquals(jissue(["show", key]), 0)
Example #28
0
 def test_not_a_bug(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["resolve", issue.key, "--resolve-as=Not a Bug"]), 0)
         raise SkipResolve()
Example #29
0
 def test_jish(self):
     with test_issue_context() as issue:
         fix_version = jira_adapter.get_next_release_name_in_project("HOSTDEV")
         jira_adapter.resolve_issue(issue.key, "Not a Bug", fix_version)
         self.assertEquals(jissue(["reopen"], dict(JISSUE_ISSUE=issue.key)), 0)
Example #30
0
 def test_jisk(self):
     with test_issue_context() as issue:
         self.assertEquals(jissue(["link", "relates", "HOSTDEV-787"], dict(JISSUE_ISSUE=issue.key)), 0)