Beispiel #1
0
 def test_can_save_event(self):
     event = self.issue_events[0]
     news = save_event(event)
     self.assertIsInstance(news, News)
     self.assertTrue(news.pk, 'Object not saved yet')
Beispiel #2
0
 def test_saved_event_has_issue_in_title(self):
     event = self.issue_events[0]
     news = save_event(event)
     self.assertRegexpMatches(news.title,
                              str(event['payload']['issue']['number']))
Beispiel #3
0
 def test_saved_event_should_have_link(self):
     event = self.issue_events[0]
     news = save_event(event)
     url = event['payload']['issue']['html_url']
     self.assertEquals(news.link, url)
Beispiel #4
0
 def test_saved_event_has_correct_action_in_title(self):
     event = self.issue_events[0]
     for action in ['opened', 'closed', 'reopened']:
         event['payload']['action'] = action
         news = save_event(event)
         self.assertRegexpMatches(news.title, action)
Beispiel #5
0
 def test_saved_event_has_actor_in_title(self):
     event = self.issue_events[0]
     news = save_event(event)
     self.assertRegexpMatches(news.title, event['actor']['login'])
Beispiel #6
0
 def test_can_save_event(self):
     event = self.issue_events[0]
     news = save_event(event)
     self.assertIsInstance(news, News)
     self.assertTrue(news.pk, 'Object not saved yet')
Beispiel #7
0
 def test_saved_event_should_have_link(self):
     event = self.issue_events[0]
     news = save_event(event)
     url = event['payload']['issue']['html_url']
     self.assertEquals(news.link, url)
Beispiel #8
0
 def test_saved_event_has_issue_in_title(self):
     event = self.issue_events[0]
     news = save_event(event)
     self.assertRegexpMatches(news.title, str(event['payload']['issue']['number']))
Beispiel #9
0
 def test_saved_event_has_actor_in_title(self):
     event = self.issue_events[0]
     news = save_event(event)
     self.assertRegexpMatches(news.title, event['actor']['login'])
Beispiel #10
0
 def test_saved_event_has_correct_action_in_title(self):
     event = self.issue_events[0]
     for action in ['opened', 'closed', 'reopened']:
         event['payload']['action'] = action
         news = save_event(event)
         self.assertRegexpMatches(news.title, action)