def test_upload_document_failure(self):
        docket = DocketXML('nysd', '1234')
        docnum, subdocnum = self.docmap.keys()[0].split('-')
        docket.add_document(docnum, subdocnum)
        # Sanity Check
        self.assertFalse(docket.get_document_metadict(docnum, subdocnum).get('available'))

        success, msg = ia_uploader._upload_documents(docket, self.docmap)
        self.assertFalse(success)
        self.assertEquals("0", docket.get_document_metadict(docnum, subdocnum)['available'])
    def test_upload_document_success(self):
        docket = DocketXML('nysd', '1234')
        docnum, subdocnum = self.docmap.keys()[0].split('-')
        docket.add_document(docnum, subdocnum)
        # Sanity Check
        self.assertFalse(docket.get_document_metadict(docnum, subdocnum).get('available'))

        success, msg = ia_uploader._upload_documents(docket, self.docmap)
        self.assertTrue(success)
        self.assertEquals("1", docket.get_document_metadict(docnum, subdocnum)['available'])
        #sha1 of "documentfilebits"
        self.assertEquals("0fff5bc4b311d46f0bad0c840a59ec6859276265",
                          docket.get_document_metadict(docnum, subdocnum)['sha1'])