def _create_fixtures(app, sample_csids): fixture_output = os.environ.get( 'FIXTURE_OUTPUT_PATH') or mockingbird._get_fixtures_path() cl = Client(app) cl.server.info.to_file(f'{fixture_output}/calnet_server_info.json') cl.server.schema.to_file(f'{fixture_output}/calnet_server_schema.json') conn = cl.connect() conn.search('ou=people,dc=berkeley,dc=edu', cl._csids_filter(sample_csids), attributes=ldap3.ALL_ATTRIBUTES) conn.response_to_file(f'{fixture_output}/calnet_search_entries.json', raw=True) conn.unbind()
def _fixture_path(pattern): fixtures_path = mockingbird._get_fixtures_path() return '{}/calnet_{}.json'.format(fixtures_path, pattern)
def _fixture_path(pattern): fixtures_path = mockingbird._get_fixtures_path() return f'{fixtures_path}/calnet_{pattern}.json'