Esempio n. 1
0
    def test_upload_docket_does_nothing_if_no_differences(self):
        # Given a docketxml object, upload the docket, 
        # by downloading, merging and uploading
        same_docket = DocketXML('nysd', '1234')
        with patch('uploads.ia_uploader._get_docket_from_IA', 
                    Mock(return_value=(same_docket, None))):
            success, msg = ia_uploader.upload_docket(same_docket, None)

        self.assertTrue(success)
        self.assertEquals(msg, 'Unmodified')
Esempio n. 2
0
 def test_upload_docket_no_existing_IA_docket(self):
     docket = DocketXML('nysd', '1234')
     success, msg = ia_uploader.upload_docket(docket, None)
     self.assertTrue(success)
     # docket upload and html docket upload
     self.assertEquals(2, self.mock_open.call_count)
     docket_url = self.mock_open.call_args_list[0][0][0].get_full_url()
     html_url = self.mock_open.call_args_list[1][0][0].get_full_url()
     self.assertTrue(docket_url.find('gov.uscourts.nysd.1234.docket.xml') > 0)
     self.assertTrue(html_url.find('gov.uscourts.nysd.1234.docket.html') > 0)