def setUp(self): super(BaseClientTest, self).setUp() configure_logging() self.maxDiff = None instance = os.environ.get('PMI_DRC_RDR_INSTANCE') or _DEFAULT_INSTANCE creds_file = os.environ.get('TESTING_CREDS_FILE') self.client = Client(parse_cli=False, default_instance=instance, creds_file=creds_file) self.offline_client = Client(base_path=_OFFLINE_BASE_PATH, parse_cli=False, default_instance=instance, creds_file=creds_file)
client, participant_id, consent_questionnaire_id_and_version, consent_questions, answer_map) for questionnaire_id_and_version, questions in questionnaire_to_questions.iteritems( ): if questionnaire_id_and_version != consent_questionnaire_id_and_version: _submit_questionnaire_response( client, participant_id, questionnaire_id_and_version, questions, answer_map) logging.info('%s created from row %d (%r %r).', participant_id, reader.line_num, row['first_name'], row['last_name']) num_participants += 1 logging.info('%d participants imported.' % num_participants) if __name__ == '__main__': configure_logging() parser = get_parser() parser.add_argument( '--file', help='Path to the CSV file containing the participant data.', default=HEALTHPRO_PARTICIPANTS_FILE) parser.add_argument( '--instance', type=str, help='The instance to hit, defaults to http://localhost:8080', default='http://localhost:8080') parser.add_argument('--creds_file', type=str, help='Path to credentials JSON file.') main(parser.parse_args())