def test_no_xpctl_leaves_others(): key = 'visdom' value = {'env': 'example'} input_ = {'reporting': {'xpctl': {}, key: value}} override_client_settings(input_, None, None) assert 'xpctl' not in input_['reporting'] assert key in input_['reporting'] assert input_['reporting'][key] == value
def test_handles_no_reporting(): input_ = {} gold = 'server-cred' override_client_settings(input_, None, gold) assert 'reporting' not in input_
def test_handles_no_xpctl(): input_ = {'reporting': {}} gold = 'server-cred' override_client_settings(input_, None, gold) assert 'xpctl' not in input_
def test_xpctl_adds(): input_ = {'reporting': {'xpctl': {}}} gold = 'server-cred' override_client_settings(input_, None, gold) assert input_['reporting']['xpctl']['cred'] == gold
def test_no_xpctl_removes_client(): input_ = {'reporting': {'xpctl': {'label': 'client_stuff'}}} override_client_settings(input_, None, None) assert 'xpctl' not in input_['reporting']
def test_cache_added(): input_ = {} gold = 'server_cache' override_client_settings(input_, gold, None) assert input_['datacache'] == gold
def test_cache_overwritten(): old = 'client_cache' input_ = {'datacache': old} gold = 'server_cache' override_client_settings(input_, gold, None) assert input_['datacache'] == gold