Ejemplo n.º 1
0
 def test_007_attachment(self):
     """This test does the following:
     * add an attachment to the TestRun.
     * verify that there is 1 attachment with the correct title
     * verify the get_attachment function
     * verify the get_attachments function
     * delete the attachment
     * verify that there are no attachments.
     """
     tr = TestRun(project_id=DEFAULT_PROJ, test_run_id=TEST_RUN_ID)
     tr.add_attachment(ATTACH_PATH, ATTACH_TITLE)
     tr.reload()
     self.assertEqual(len(tr.attachments), 1)
     self.assertEqual(tr.attachments[0].title, ATTACH_TITLE)
     attach = tr.get_attachment(tr.attachments[0].filename)
     self.assertEqual(tr.attachments[0].title, attach.title)
     lst_attach = tr.get_attachments()
     self.assertEqual(lst_attach[0].title, attach.title)
     tr.delete_attachment(tr.attachments[0].filename)
     tr.reload()
     self.assertEqual(tr.attachments, [])