def test_force_xpctl_ignores_rest(): gold = 'xpctl-label' key = 'visdom' value = {'example': 'example'} xp_key = 'user' xp_value = 'root' input_ = { 'reporting': { key: value, 'xpctl': { xp_key: xp_value, } } } force_xpctl(input_, gold) assert key in input_['reporting'] assert input_['reporting'][key] == value assert xp_key in input_['reporting']['xpctl'] assert input_['reporting']['xpctl'][xp_key] == xp_value
def test_force_xpctl_skips_None(): input_ = {} force_xpctl(input_, None) assert 'label' not in input_['reporting']['xpctl']
def test_force_xpctl_adds_label(): gold = 'xpctl-label' input_ = {} force_xpctl(input_, gold) assert input_['reporting']['xpctl']['label'] == gold
def test_force_xpctl_adds_both(): input_ = {} force_xpctl(input_, None) assert 'reporting' in input_ assert 'xpctl' in input_['reporting']
def test_force_xpctl_adds_xpctl(): input_ = {'reporting': {}} force_xpctl(input_, None) assert 'xpctl' in input_['reporting']
def test_force_xpctl_adds_reporting(): input_ = {} force_xpctl(input_, None) assert 'reporting' in input_