def test_doNotOverwriteWithUnknownReporter(self):
     item = JiraTrackerItem()
     withReporter = "reporter"
     load = self.create_loader(JiraTrackerItem.withRequestor)
     load(item, withReporter)
     item.withRequestor(JiraUser(None))
     self.assertEqual(withReporter, item.requestor().jira())
Beispiel #2
0
 def test_doNotOverwriteWithUnknownReporter(self):
     item = JiraTrackerItem()
     withReporter = "reporter"
     load = self.create_loader(JiraTrackerItem.withRequestor)
     load(item, withReporter)
     item.withRequestor(JiraUser(None))
     self.assertEqual(withReporter, item.requestor().jira())
 def test_canOverwriteKnownReporter(self):
     item = JiraTrackerItem()
     withReporter = "reporter"
     load = self.create_loader(JiraTrackerItem.withRequestor)
     load(item, withReporter)
     random = mock()
     when(random).jira().thenReturn("blah")
     item.withRequestor(random)
     self.assertEqual(random, item.requestor())
 def test_canChangeReporter(self):
     item = JiraTrackerItem()        
     requestor = mock()
     reporter = "me"
     when(requestor).jira().thenReturn(reporter).thenReturn(reporter)
     item.withRequestor(requestor)
     self.assertEqual(requestor, item.requestor())
     self.assertEqual(reporter, item.underlying().reporter())
     self.assertEqual(item.piecesToUpdate(), [{'id':"reporter" , 'values':[reporter,]}])
Beispiel #5
0
 def test_canOverwriteKnownReporter(self):
     item = JiraTrackerItem()
     withReporter = "reporter"
     load = self.create_loader(JiraTrackerItem.withRequestor)
     load(item, withReporter)
     random = mock()
     when(random).jira().thenReturn("blah")
     item.withRequestor(random)
     self.assertEqual(random, item.requestor())
 def test_doNotOverwriteUnknownReporter(self):
     item = JiraTrackerItem()
     withReporter = "reporter"
     load = self.create_loader(JiraTrackerItem.withRequestor)
     load(item, withReporter)
     PivotalToJiraUserMap().reset()
     random = "me"
     item.withRequestor(JiraUser(random))
     self.assertNotEqual(random, item.requestor().jira())
     self.assertEqual(withReporter, item.requestor().jira())
Beispiel #7
0
 def test_doNotOverwriteUnknownReporter(self):
     item = JiraTrackerItem()
     withReporter = "reporter"
     load = self.create_loader(JiraTrackerItem.withRequestor)
     load(item, withReporter)
     PivotalToJiraUserMap().reset()
     random = "me"
     item.withRequestor(JiraUser(random))
     self.assertNotEqual(random, item.requestor().jira())
     self.assertEqual(withReporter, item.requestor().jira())
Beispiel #8
0
 def test_canChangeReporter(self):
     item = JiraTrackerItem()
     requestor = mock()
     reporter = "me"
     when(requestor).jira().thenReturn(reporter).thenReturn(reporter)
     item.withRequestor(requestor)
     self.assertEqual(requestor, item.requestor())
     self.assertEqual(reporter, item.underlying().reporter())
     self.assertEqual(item.piecesToUpdate(), [{
         'id': "reporter",
         'values': [
             reporter,
         ]
     }])
 def test_doNotAddDuplicateReporter(self):
     testTicket = mock()
     item = JiraTrackerItem(testTicket)
     item.withRequestor(JiraUser(testTicket.reporter)) 
     self.assertEqual(item.piecesToUpdate(), [])
Beispiel #10
0
 def test_doNotAddDuplicateReporter(self):
     testTicket = mock()
     item = JiraTrackerItem(testTicket)
     item.withRequestor(JiraUser(testTicket.reporter))
     self.assertEqual(item.piecesToUpdate(), [])