def testReportTypes(self): "A number of report types are mapped to directories" for e in ('essence_pcE', 'essence_pcI', 'essence_pcO', 'essence'): doc_id = self.create_test_file(compression='gzip', reportable_region='wae', report_type=e) agent = PHINMS_Transfer(self.oid) document = self.document_store.find_one(doc_id) agent._set_report_type(document.get('report_type', None), document.get('patient_class', None)) self.assertTrue(agent.outbound_dir)
def testPhinmsTransfer(self): # need a document in the db self.create_test_file(compression='gzip', report_type='longitudinal') # fake a transfer of this object context = PHINMS_Transfer(testing.DummyRequest()) context.request.fs = self.fs context.request.document_store = self.document_store context = context[str(self.oid)] self.assertFalse(inProduction()) # avoid accidental transfers! context.transfer_file() self.assertEqual(self.report_type, 'longitudinal') config = Config() path = config.get('phinms', self.report_type) self.assertEqual(context.outbound_dir, path)