def build_profile(): profile = Profile( 'httpbin', base='https://httpbin.org', test=True) return profile
async def test_init(self): profile = build_profile() assert type(profile) is Profile profile = Profile(1, base=1, test=True) assert profile.name == 'default' assert profile.base == 'default' profile.db.close()
async def test_update(self): profile = build_profile() profile.base = 'http://httpbin.org' profile.update() del profile profile = Profile('httpbin', test=True) assert profile.base == 'http://httpbin.org' profile.db.close()
def __init__(self): """ Initialize Lusha API client. Though it uses ERGAL for most request processing, this class has blocks to parse out the desired data from returned records. This initialization assumes that the API profile for Lusha has already been created and is stored in a local ergal.db sqlite database file. """ self.profile = Profile('Lusha API', base='https://api.lusha.co')
def __init__(self): """ Initialize the DiscoverOrg API client. Also integrates pretty directly with ERGAL, but has some utility code to parse responses of different types. """ self.profile = Profile('DiscoverOrg API', base='https://papi.discoverydb.com/papi/v1') session_key = self._get_session_key() self.profile.set_auth('key-header', key=session_key, name='X-AUTH-TOKEN')
async def test_delete(self): profile = build_profile() profile.delete() profile = Profile('httpbin', 'http://httpbin.org', test=True) assert profile.base == 'http://httpbin.org'