def test_cannotSetRequestorForStory(self):
     story = Story()
     requestor = "me"
     story.SetRequestedBy(requestor)
     item = PivotalTrackerItem(story)
     item.withRequestor(PivotalUser(requestor))
     self.assertEqual([], item.decoratedStory().UPDATE_FIELDS)
 def test_canGetTimeUpdatedAt(self):
     story = Story()
     story.updated_at = 1240433216
     timezone = UTC()
     item = PivotalTrackerItem(story, timezone)
     self.assertEqual("2009/04/22 20:46:56", item.updatedAt().strftime("%Y/%m/%d %H:%M:%S"))
     self.assertEqual(None, item.updatedAt().tzinfo)
 def test_cannotSetOwnerForStory(self):
     story = Story()
     owner = "me"
     story.SetOwnedBy(owner)
     item = PivotalTrackerItem(story)
     item.withOwner(PivotalUser(owner))
     self.assertEqual([], item.decoratedStory().UPDATE_FIELDS)
 def test_canAddCommentsToStory(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary("test_canAddCommentsToStory").withDescription("description")
     tracker.update(item)
     aComment = Testing.addCommentToItemIn(tracker)
     item = next(tracker.items())
     self.assertEqual(item.comments()[0], aComment)
 def test_cannotAddNoneStatus(self):
     story = Story()
     startingStatus = "unscheduled"
     story.SetCurrentState(startingStatus)
     item = PivotalTrackerItem(story)
     item.withStatus(None)
     self.assertEqual(startingStatus, item.status().pivotal())
     self.assertEqual([], item.decoratedStory().UPDATE_FIELDS)
 def test_canRemoveAllStoriesFromPivotal(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary("test_canRemoveAllStoriesFromPivotal-1")
     tracker.update(item)
     item.withSummary("test_canRemoveAllStoriesFromPivotal-2")
     tracker.update(item)
     tracker.deleteAllItems()
     self.assertRaises(StopIteration, next, tracker.items())
 def test_cannotSetNoneTypeForStory(self):
     story = Story()
     defaultStoryType = "feature"
     story.SetStoryType(defaultStoryType)
     item = PivotalTrackerItem(story)
     item.withType(None)
     self.assertEqual(story.GetStoryType(), defaultStoryType)
     self.assertEqual([], item.decoratedStory().UPDATE_FIELDS)
 def test_whenCommentAddedStoryIsAvailableToUpdate(self):
     story = Story()
     story.story_id = 1234
     item = PivotalTrackerItem(story)
     comment = "blah"
     item.addComment(comment)
     storyToBeUpdated = item.decoratedStory()
     self.assertEqual(story.story_id, storyToBeUpdated.GetStoryId())
 def test_whenTryingToChangeDescriptionToDuplicateDescriptionNoUpdateIsMade(self):
     description = "description"
     story = Story()
     story.SetDescription(description)
     item = PivotalTrackerItem(story)
     item.withDescription(description)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetDescription())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
 def test_summaryAndDescriptionValidForItemWhenSeededWithExistingValidStorySummaryAndDescription(self):
     story = Story()
     description = "Hello World"
     summary = "HW"
     story.description = description
     story.name = summary
     item = PivotalTrackerItem(story)
     self.assertEqual(item.summary(), summary)
     self.assertEqual(item.description(), description)
 def test_doNotUpdateJiraUrlOnStoryWhenUpdatedWithDuplicate(self):
     story = Story()
     updateUrl = "http://www.updated.com"
     story.jira_url = updateUrl
     item = PivotalTrackerItem(story)
     item.withJiraUrl(updateUrl)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetDescription())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
Ejemplo n.º 12
0
 def test_whenTryingToChangeStatusToDuplicateStatusNoUpdateIsMade(self):
     summary = "summary"
     story = Story()
     story.SetName(summary)
     item = PivotalTrackerItem(story)
     item.withSummary(summary)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetName())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
 def test_canAdjustStateOfTicket(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary(
         "test_canAdjustStateOfTicket-1").withDescription(
             "can change the status of this ticket?").withType("bug")
     done = Testing.putItemToTrackerAndChangeStatusTo(
         "accepted", item, tracker)
     item = next(tracker.items())
     self.assertEqual(item.status(), done)
 def test_canGetRequestor(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary(
         "test_canGetRequestor-1").withDescription(
             "can get the requestor of this ticket?")
     tracker.update(item)
     item = next(tracker.items())
     self.assertTrue(
         Env().get("pivotal", "username") in item.requestor().pivotal())
 def test_canAddStoryToPivotal(self):
     tracker = self.pivotal_
     name = "test_canAddStoryToPivotal"
     description = "this is a test"
     item = PivotalTrackerItem(Story()).withSummary(name).withDescription(description)
     tracker.update(item)
     item = next(tracker.items())
     self.assertEqual(item.summary(), name)
     self.assertEqual(item.description(), description)
Ejemplo n.º 16
0
 def test_doNotUpdateJiraKeyOnStoryWhenUpdatedWithDuplicate(self):
     story = Story()
     updateJiraId = "TEST-12345"
     story.jira_id = updateJiraId
     item = PivotalTrackerItem(story)
     item.withJiraKey(updateJiraId)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetName())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
 def test_itemConstructedWithDecoratedStoryWithJiraKeyGetsValidDescriptionWithHTTPS(self):
     story = Story()
     jiraUrl = "https://www.jira.com/TEST-pa1234"
     description = "this is a test\nwith\nmultiple\nlines" 
     decoratedDescription = "https://www.jira.com/TEST-pa1234\n" + description
     story.SetDescription(decoratedDescription)
     item = PivotalTrackerItem(story)
     self.assertEqual(item.description(), description)
     self.assertEqual(item.jiraUrl(), jiraUrl)
 def test_whenTryingToChangeStatusToDuplicateStatusNoUpdateIsMade(self):
     summary = "summary"
     story = Story()
     story.SetName(summary)
     item = PivotalTrackerItem(story)
     item.withSummary(summary)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetName())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
 def test_itemConstructedWithDecoratedStoryWithJiraKeyGetsValidSummary(self):
     story = Story()
     jiraKey = "TEST-pti1234"
     summary = "summary"
     decoratedSummary = "[TEST-pti1234]: summary"
     story.SetName(decoratedSummary)
     item = PivotalTrackerItem(story)
     self.assertEqual(item.summary(), summary)
     self.assertEqual(item.jiraKey(), jiraKey)
 def test_doNotUpdateJiraKeyOnStoryWhenUpdatedWithDuplicate(self):
     story = Story()
     updateJiraId = "TEST-12345"
     story.jira_id = updateJiraId
     item = PivotalTrackerItem(story)
     item.withJiraKey(updateJiraId)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetName())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
Ejemplo n.º 21
0
 def test_doNotUpdateJiraUrlOnStoryWhenUpdatedWithDuplicate(self):
     story = Story()
     updateUrl = "http://www.updated.com"
     story.jira_url = updateUrl
     item = PivotalTrackerItem(story)
     item.withJiraUrl(updateUrl)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetDescription())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
Ejemplo n.º 22
0
 def test_changingDescriptionChangesPivotalStoryDescription(self):
     item = PivotalTrackerItem()
     description = "New"
     returnedItem = item.withDescription(description)
     self.assertEqual(item.underlying().GetDescription(), description)
     self.assertEqual(returnedItem, item)
     storyToUpdate = returnedItem.decoratedStory()
     self.assertEqual(description, storyToUpdate.GetDescription())
     self.assertTrue('description' in storyToUpdate.UPDATE_FIELDS)
     pass
 def test_changingSummaryChangesPivotalStorySummary(self):
     item = PivotalTrackerItem()
     summary = "New"
     returnedItem = item.withSummary(summary)
     self.assertEqual(item.underlying().GetName(), summary)
     self.assertEqual(returnedItem, item)
     storyToUpdate = returnedItem.decoratedStory()
     self.assertEqual(summary, storyToUpdate.GetName())
     self.assertTrue('name' in storyToUpdate.UPDATE_FIELDS)
     pass
Ejemplo n.º 24
0
 def test_itemConstructedWithDecoratedStoryWithJiraKeyGetsValidDescriptionWithHTTPS(
         self):
     story = Story()
     jiraUrl = "https://www.jira.com/TEST-pa1234"
     description = "this is a test\nwith\nmultiple\nlines"
     decoratedDescription = "https://www.jira.com/TEST-pa1234\n" + description
     story.SetDescription(decoratedDescription)
     item = PivotalTrackerItem(story)
     self.assertEqual(item.description(), description)
     self.assertEqual(item.jiraUrl(), jiraUrl)
Ejemplo n.º 25
0
 def test_summaryAndDescriptionValidForItemWhenSeededWithExistingValidStorySummaryAndDescription(
         self):
     story = Story()
     description = "Hello World"
     summary = "HW"
     story.description = description
     story.name = summary
     item = PivotalTrackerItem(story)
     self.assertEqual(item.summary(), summary)
     self.assertEqual(item.description(), description)
Ejemplo n.º 26
0
 def test_whenTryingToChangeDescriptionToDuplicateDescriptionNoUpdateIsMade(
         self):
     description = "description"
     story = Story()
     story.SetDescription(description)
     item = PivotalTrackerItem(story)
     item.withDescription(description)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(None, storyToUpdate.GetDescription())
     self.assertEqual([], storyToUpdate.UPDATE_FIELDS)
Ejemplo n.º 27
0
 def test_changingSummaryChangesPivotalStorySummary(self):
     item = PivotalTrackerItem()
     summary = "New"
     returnedItem = item.withSummary(summary)
     self.assertEqual(item.underlying().GetName(), summary)
     self.assertEqual(returnedItem, item)
     storyToUpdate = returnedItem.decoratedStory()
     self.assertEqual(summary, storyToUpdate.GetName())
     self.assertTrue('name' in storyToUpdate.UPDATE_FIELDS)
     pass
 def test_canAddStoryToPivotal(self):
     tracker = self.pivotal_
     name = "test_canAddStoryToPivotal"
     description = "this is a test"
     item = PivotalTrackerItem(
         Story()).withSummary(name).withDescription(description)
     tracker.update(item)
     item = next(tracker.items())
     self.assertEqual(item.summary(), name)
     self.assertEqual(item.description(), description)
 def test_canUpdateJiraUrlOnStory(self):
     story = Story()
     story.jira_url = "http://www.test.com"
     updateUrl = "http://www.updated.com"
     item = PivotalTrackerItem(story)
     item.withJiraUrl(updateUrl)
     self.assertEqual(item.jiraUrl(), updateUrl)
     storyToUpdate = item.decoratedStory()
     self.assertEqual(updateUrl+"\nNone", storyToUpdate.GetDescription())
     self.assertTrue('description' in storyToUpdate.UPDATE_FIELDS)
 def test_changingDescriptionChangesPivotalStoryDescription(self):
     item = PivotalTrackerItem()
     description = "New"
     returnedItem = item.withDescription(description)
     self.assertEqual(item.underlying().GetDescription(), description)
     self.assertEqual(returnedItem, item)
     storyToUpdate = returnedItem.decoratedStory()
     self.assertEqual(description, storyToUpdate.GetDescription())
     self.assertTrue('description' in storyToUpdate.UPDATE_FIELDS)
     pass
 def test_canChangeStoryType(self):
     tracker = self.pivotal_
     itemType = "bug"
     item = PivotalTrackerItem().withSummary("test_canChangeStoryType-1").withDescription("can change the type of this ticket?")
     tracker.update(item)
     item = next(tracker.items())
     item.withType(itemType)
     tracker.update(item)
     updatedItem = next(tracker.items())
     self.assertEqual(itemType, updatedItem.type())
 def test_canChangeRequestor(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary("test_canChangeRequestor-1").withDescription("can change the requestor of this ticket?")  
     tracker.update(item)
     item = next(tracker.items())
     newRequestor = PivotalUser(Env().get("pivotal", "otherUser"))
     item.withRequestor(newRequestor)
     tracker.update(item)
     item = next(tracker.items())
     self.assertTrue(Env().get("pivotal", "otherUser") in item.requestor().pivotal())
Ejemplo n.º 33
0
 def test_itemConstructedWithDecoratedStoryWithJiraKeyGetsValidSummary(
         self):
     story = Story()
     jiraKey = "TEST-pti1234"
     summary = "summary"
     decoratedSummary = "[TEST-pti1234]: summary"
     story.SetName(decoratedSummary)
     item = PivotalTrackerItem(story)
     self.assertEqual(item.summary(), summary)
     self.assertEqual(item.jiraKey(), jiraKey)
 def test_canChangeOwner(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary("test_canChangeOwner-1").withDescription("can change the owner of this ticket?").withType("bug")  
     Testing.putItemToTrackerAndChangeStatusTo("started", item, tracker)
     item = next(tracker.items())
     newOwner = PivotalUser(Env().get("pivotal", "otherUser"))
     item.withOwner(newOwner)
     tracker.update(item)
     item = next(tracker.items())
     self.assertTrue(Env().get("pivotal", "otherUser") in item.owner().pivotal())   
 def test_canUpdateJiraKeyOnStory(self):
     story = Story()
     story.jira_id = "TEST-pti1234"
     updateJiraId = "TEST-12345"
     item = PivotalTrackerItem(story)
     item.withJiraKey(updateJiraId)
     self.assertEqual(item.jiraKey(), updateJiraId)
     storyToUpdate = item.decoratedStory()
     self.assertEqual("[" + updateJiraId + "]: None", storyToUpdate.GetName())
     self.assertTrue('name' in storyToUpdate.UPDATE_FIELDS)
 def test_previouslyExistingJiraInformationIsNotOverwritternBecauseDecoratedStoryDoesNotYetContainIt(self):
     story = Story()
     jiraId = "blah"
     jiraUrl = "blah2"
     story.jira_id = jiraId
     story.jira_url = jiraUrl
     story.SetName("name")
     story.SetDescription("description")
     item = PivotalTrackerItem(story)
     self.assertEqual(item.jiraKey(), jiraId)
     self.assertEqual(item.jiraUrl(), jiraUrl)
 def test_canDownloadStoriesFromPivotalTracker(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary("test_canDownloadStoriesFromPivotalTracker-1")
     tracker.update(item)
     item.withSummary("test_canDownloadStoriesFromPivotalTracker-2")
     tracker.update(item)
     itemIterator = tracker.items()
     next(itemIterator)
     next(itemIterator)
     self.assertRaises(StopIteration, next, itemIterator)
     pass
 def test_canDownloadStoriesFromPivotalTracker(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary(
         "test_canDownloadStoriesFromPivotalTracker-1")
     tracker.update(item)
     item.withSummary("test_canDownloadStoriesFromPivotalTracker-2")
     tracker.update(item)
     itemIterator = tracker.items()
     next(itemIterator)
     next(itemIterator)
     self.assertRaises(StopIteration, next, itemIterator)
     pass
 def test_canUpdateItemAlreadyInPivotal(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary("test_canUpdateItemAlreadyInPivotal-to update").withDescription("can update?")
     tracker.update(item)
     item = next(tracker.items())
     newSummary = "test_canUpdateItemAlreadyInPivotal-1"
     newDescription = "yep - updated"
     item.withSummary(newSummary).withDescription(newDescription)
     tracker.update(item)
     item = next(tracker.items())
     self.assertEqual(item.summary(), newSummary)
     self.assertEqual(item.description(), newDescription)
 def test_canChangeStoryType(self):
     tracker = self.pivotal_
     itemType = "bug"
     item = PivotalTrackerItem().withSummary(
         "test_canChangeStoryType-1").withDescription(
             "can change the type of this ticket?")
     tracker.update(item)
     item = next(tracker.items())
     item.withType(itemType)
     tracker.update(item)
     updatedItem = next(tracker.items())
     self.assertEqual(itemType, updatedItem.type())
Ejemplo n.º 41
0
 def test_previouslyExistingJiraInformationIsNotOverwritternBecauseDecoratedStoryDoesNotYetContainIt(
         self):
     story = Story()
     jiraId = "blah"
     jiraUrl = "blah2"
     story.jira_id = jiraId
     story.jira_url = jiraUrl
     story.SetName("name")
     story.SetDescription("description")
     item = PivotalTrackerItem(story)
     self.assertEqual(item.jiraKey(), jiraId)
     self.assertEqual(item.jiraUrl(), jiraUrl)
 def test_canChangeRequestor(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary(
         "test_canChangeRequestor-1").withDescription(
             "can change the requestor of this ticket?")
     tracker.update(item)
     item = next(tracker.items())
     newRequestor = PivotalUser(Env().get("pivotal", "otherUser"))
     item.withRequestor(newRequestor)
     tracker.update(item)
     item = next(tracker.items())
     self.assertTrue(
         Env().get("pivotal", "otherUser") in item.requestor().pivotal())
 def test_canChangeOwner(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary(
         "test_canChangeOwner-1").withDescription(
             "can change the owner of this ticket?").withType("bug")
     Testing.putItemToTrackerAndChangeStatusTo("started", item, tracker)
     item = next(tracker.items())
     newOwner = PivotalUser(Env().get("pivotal", "otherUser"))
     item.withOwner(newOwner)
     tracker.update(item)
     item = next(tracker.items())
     self.assertTrue(
         Env().get("pivotal", "otherUser") in item.owner().pivotal())
Ejemplo n.º 44
0
 def test_itemWithoutJiraInfoDoesNotDecorate(self):
     item = PivotalTrackerItem(Story())
     description = "description"
     summary = "summary"
     item.withDescription(description)
     item.withSummary(summary)
     self.assertEqual(item.decoratedStory().GetDescription(), description)
     self.assertEqual(item.decoratedStory().GetName(), summary)
 def test_canFilterStoriesReturnedFromTrackerOnlyOneMatchIsFound(self):
     tracker = self.pivotal_
     forFilter = "searchForMe"
     item = PivotalTrackerItem().withSummary(forFilter).withDescription(
         "description")
     tracker.update(item)
     time.sleep(2)
     item = PivotalTrackerItem().withSummary(
         "test_canFilterStoriesReturnedFromTrackerOnlyOneMatchIsFound"
     ).withDescription("description")
     tracker.update(item)
     time.sleep(4)
     itemIterator = tracker.items(forFilter)
     next(itemIterator)
     self.assertRaises(StopIteration, next, itemIterator)
 def test_canFilterStoriesReturnedFromTrackerSoNoMatchesAreFound(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary(
         "test_canFilterStoriesReturnedFromTracker").withDescription(
             "description")
     tracker.update(item)
     forFilter = "label:garabage"
     self.assertRaises(StopIteration, next, tracker.items(forFilter))
Ejemplo n.º 47
0
 def test_canSetOwner(self):
     item = PivotalTrackerItem()
     owner = "me"
     item.withOwner(PivotalUser(owner))
     self.assertEqual(owner, item.owner().pivotal())
     self.assertEqual(owner, item.underlying().GetOwnedBy())
     self.assertTrue('owned_by' in item.decoratedStory().UPDATE_FIELDS)
Ejemplo n.º 48
0
 def test_canSetRequestor(self):
     item = PivotalTrackerItem()
     requestor = "me"
     item.withRequestor(PivotalUser(requestor))
     self.assertEqual(requestor, item.requestor().pivotal())
     self.assertEqual(requestor, item.underlying().GetRequestedBy())
     self.assertTrue('requested_by' in item.decoratedStory().UPDATE_FIELDS)
 def test_itemWithoutJiraInfoDoesNotDecorate(self):
     item = PivotalTrackerItem(Story())
     description = "description"
     summary = "summary"
     item.withDescription(description)
     item.withSummary(summary)
     self.assertEqual(item.decoratedStory().GetDescription(), description)
     self.assertEqual(item.decoratedStory().GetName(), summary)
Ejemplo n.º 50
0
 def test_canDecorateStorySummaryWithJiraInfo(self):
     item = PivotalTrackerItem()
     jiraKey = "TEST-pti1234"
     summary = "summary"
     decoratedSummary = "[TEST-pti1234]: summary"
     item.withSummary(summary)
     item.withJiraKey(jiraKey)
     self.assertEqual(item.decoratedStory().GetName(), decoratedSummary)
Ejemplo n.º 51
0
 def test_cannotSetDuplicateTypeForStory(self):
     story = Story()
     defaultStoryType = "feature"
     story.SetStoryType(defaultStoryType)
     item = PivotalTrackerItem(story)
     item.withType(item.type())
     self.assertEqual(defaultStoryType, item.type())
     self.assertEqual([], item.decoratedStory().UPDATE_FIELDS)
Ejemplo n.º 52
0
 def test_cannotSetDuplicateStatusForStory(self):
     story = Story()
     startingStatus = "unscheduled"
     story.SetCurrentState(startingStatus)
     item = PivotalTrackerItem(story)
     item.withStatus(item.status())
     self.assertEqual(startingStatus, item.status().pivotal())
     self.assertEqual([], item.decoratedStory().UPDATE_FIELDS)
Ejemplo n.º 53
0
 def test_canDecorateStoryDescriptionWithJiraInfo(self):
     item = PivotalTrackerItem()
     jiraUrl = "https://www.jira.com/browse/TEST-pti1234"
     description = "description"
     decoratedDescription = "https://www.jira.com/browse/TEST-pti1234\ndescription"
     item.withDescription(description)
     item.withJiraUrl(jiraUrl)
     self.assertEqual(item.decoratedStory().GetDescription(),
                      decoratedDescription)
 def test_storyUpdatedWhenNotChangedDoesNotModifyStory(self):
     tracker = self.pivotal_
     item = PivotalTrackerItem().withSummary(
         "test_storyUpdatedWhenNotChangedDoesNotModifyStory"
     ).withDescription("description")
     tracker.update(item)
     itemInPivotal = next(tracker.items())
     itemInPivotal.syncWith(itemInPivotal)
     tracker.update(itemInPivotal)
     updatedItem = next(tracker.items())
     self.assertEquals(itemInPivotal.updatedAt(), updatedItem.updatedAt())
 def test_canSetOwner(self):
     item = PivotalTrackerItem()
     owner = "me"
     item.withOwner(PivotalUser(owner))
     self.assertEqual(owner, item.owner().pivotal())
     self.assertEqual(owner, item.underlying().GetOwnedBy())
     self.assertTrue('owned_by' in item.decoratedStory().UPDATE_FIELDS)
 def test_canSetRequestor(self):
     item = PivotalTrackerItem()
     requestor = "me"
     item.withRequestor(PivotalUser(requestor))
     self.assertEqual(requestor, item.requestor().pivotal())
     self.assertEqual(requestor, item.underlying().GetRequestedBy())
     self.assertTrue('requested_by' in item.decoratedStory().UPDATE_FIELDS)
 def test_canAddAndUpdateJiraLinksToPivotalStories(self):
     tracker = self.pivotal_
     newUrl = "https://www.jira.com/TEST-pa1234"
     jiraTicketKey = "TEST-pa1234"
     description = "this is a test\nwith\nmultiple\nlines"
     item = PivotalTrackerItem().withSummary(
         "test_canAddAndUpdateJiraLinksToPivotalStories").withDescription(
             description)
     item.withJiraUrl("http://www.jira.com/TEST-pa1234").withJiraKey(
         jiraTicketKey)
     tracker.update(item)
     item = next(tracker.items())
     item.withJiraUrl(newUrl)
     tracker.update(item)
     item = next(tracker.items())
     self.assertEqual(item.jiraUrl(), newUrl)
     self.assertEqual(item.jiraKey(), jiraTicketKey)
     self.assertEqual(item.description(), description)
Ejemplo n.º 58
0
 def test_canSetTypeForStory(self):
     story = Story()
     defaultStoryType = "feature"
     story.SetStoryType(defaultStoryType)
     item = PivotalTrackerItem(story)
     self.assertEqual(defaultStoryType, item.type())
     type = "bug"
     item.withType(type)
     self.assertEqual(story.GetStoryType(), type)
     self.assertEqual(type, item.type())
     self.assertTrue('story_type' in item.decoratedStory().UPDATE_FIELDS)
 def test_canAddAndUpdateJiraLinksToPivotalStories(self):
     tracker = self.pivotal_
     newUrl = "https://www.jira.com/TEST-pa1234"
     jiraTicketKey = "TEST-pa1234"
     description = "this is a test\nwith\nmultiple\nlines"
     item = PivotalTrackerItem().withSummary("test_canAddAndUpdateJiraLinksToPivotalStories").withDescription(description)
     item.withJiraUrl("http://www.jira.com/TEST-pa1234").withJiraKey(jiraTicketKey)
     tracker.update(item)
     item = next(tracker.items())
     item.withJiraUrl(newUrl)
     tracker.update(item)
     item = next(tracker.items())
     self.assertEqual(item.jiraUrl(), newUrl)
     self.assertEqual(item.jiraKey(), jiraTicketKey)
     self.assertEqual(item.description(), description)
 def update(self, item):
     super(PivotalTrackerFor, self).update(item)
     story = item.decoratedStory()
     print("Update Pivotal Story:")
     print(story)
     print(item.comments('new'))
     if (item.Id() is None):
         story = self.trackerInstance_.AddNewStory(story)
     else:
         story = self.trackerInstance_.UpdateStory(story)
     updatedItem = PivotalTrackerItem(story).withComments(
         item.comments('new'))
     # to be fully complete updatedItem also needs exisiting comments - tbd
     return self.updateCommentsFor(updatedItem)