import requests_mock


def mock_session(base_session, service='http://example.com', user='user', pw='pw', token='token',
                 content_type='application/json', clients=['client1', 'client2']):
    get_response = {
        'App_GetClientPropertiesResponse': {
            'clientProperties': clients
        }
    }
    post_response = {
        'DM2ContentIndexing_CheckCredentialResp': {
            '@token': token
        }
    }
    headers = {
        'Accept': content_type,
        'Content-type': content_type
    }
    with requests_mock.mock() as m:
        m.get(service + '/Client', json=get_response)
        m.post(service + '/Login', headers=headers, json=post_response)
        config = {
            'service': service,
            'user': user,
            'pw': pw
        }
        session = base_session(**config)
        test_data = {
            'Clients': clients,
            'Content-type': content_type,
            'Password': pw,
            'Service': service,
            'Session': session,
            'Token': token,
            'User': user
        }
        return test_data


def validate_base_session(expected, actual):
    cache_ttl = 1200
    assert cache_ttl == actual.cache_ttl
    assert expected['Service'] == actual.service
    assert expected['User'] == actual.user
    assert expected['Password'] == actual.pw
    assert expected['Token'] == actual.headers['Authtoken']
    assert expected['Content-type'] == actual.headers['Accept']
    assert expected['Content-type'] == actual.headers['Content-type']
    assert actual.use_cache

@@ -55,16 +55,130 @@
 service=
+None, user=None, pw=None, token=None,%0A                 content_type=None, clients=None):%0A    service = service or 
 'http://
@@ -193,63 +193,102 @@
 com'
-,
+%0A   
  user
-='user', pw='pw', token=
+ = user or 'user'%0A    pw = pw or 'pw'%0A    token = token or 
 'token'
-,
 %0A    
-            
+content_type =
  con
@@ -296,17 +296,20 @@
 ent_type
-=
+ or 
 'applica
@@ -318,25 +318,28 @@
 on/json'
-,
+%0A   
  clients
 =%5B'clien
@@ -330,17 +330,30 @@
  clients
-=
+ = clients or 
 %5B'client
@@ -366,18 +366,16 @@
 lient2'%5D
-):
 %0A    get

Modify parameters to None and set in function