Example #1
0
 def test_get_notifications_url(self):
     """
     get_notifications_url should reverse the notification url and return a
     complete HTTP URL from the base provided.
     """
     self.assertEqual(
         "http://example.com/jenkins/notifications/",
         get_notifications_url("http://example.com/"))
Example #2
0
 def test_get_notifications_url(self):
     """
     get_notifications_url should reverse the notification url and return a
     complete HTTP URL from the base provided.
     """
     server = JenkinsServerFactory.create()
     self.assertEqual(
         "http://example.com/jenkins/notifications/?server=%d" % server.pk,
         get_notifications_url("http://example.com/", server))
Example #3
0
 def test_get_notifications_url(self):
     """
     get_notifications_url should reverse the notification url and return a
     complete HTTP URL from the base provided.
     """
     server = JenkinsServerFactory.create()
     self.assertEqual(
         "http://example.com/jenkins/notifications/?server=%d" % server.pk,
         get_notifications_url("http://example.com/", server))
Example #4
0
 def test_get_job_xml_for_upload(self):
     """
     get_job_xml_for_upload should take a job and return the XML that needs
     to be uploaded to build the job.
     """
     jobtype = JobTypeFactory.create(config_xml=template_config)
     job = JobFactory.create(jobtype=jobtype)
     xml_for_upload = get_job_xml_for_upload(job)
     expected_url = get_notifications_url("http://example.com/")
     self.assertIn(job.jobtype.description, xml_for_upload)
     self.assertIn(expected_url, xml_for_upload)
Example #5
0
 def test_get_job_xml_for_upload(self):
     """
     get_job_xml_for_upload should take a job and return the XML that needs
     to be uploaded to build the job.
     """
     jobtype = JobTypeFactory.create(config_xml=template_config)
     job = JobFactory.create(jobtype=jobtype)
     server = JenkinsServerFactory.create()
     xml_for_upload = get_job_xml_for_upload(job, server)
     expected_url = get_notifications_url("http://example.com/", server)
     self.assertIn(job.jobtype.description, xml_for_upload)
     self.assertIn(expected_url, xml_for_upload)