Ejemplo n.º 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')
Ejemplo n.º 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']))
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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'])
Ejemplo n.º 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')
Ejemplo n.º 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)
Ejemplo n.º 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']))
Ejemplo n.º 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'])
Ejemplo n.º 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)