Example #1
0
def build_profile():
    profile = Profile(
        'httpbin',
        base='https://httpbin.org',
        test=True)

    return profile
Example #2
0
    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()
Example #3
0
    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()
Example #4
0
    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')
Example #5
0
    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')
Example #6
0
    async def test_delete(self):
        profile = build_profile()
        profile.delete()

        profile = Profile('httpbin', 'http://httpbin.org', test=True)
        assert profile.base == 'http://httpbin.org'