Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
def test_force_xpctl_skips_None():
    input_ = {}
    force_xpctl(input_, None)
    assert 'label' not in input_['reporting']['xpctl']
Esempio n. 4
0
def test_force_xpctl_adds_label():
    gold = 'xpctl-label'
    input_ = {}
    force_xpctl(input_, gold)
    assert input_['reporting']['xpctl']['label'] == gold
Esempio n. 5
0
def test_force_xpctl_adds_both():
    input_ = {}
    force_xpctl(input_, None)
    assert 'reporting' in input_
    assert 'xpctl' in input_['reporting']
Esempio n. 6
0
def test_force_xpctl_adds_xpctl():
    input_ = {'reporting': {}}
    force_xpctl(input_, None)
    assert 'xpctl' in input_['reporting']
Esempio n. 7
0
def test_force_xpctl_adds_reporting():
    input_ = {}
    force_xpctl(input_, None)
    assert 'reporting' in input_
Esempio n. 8
0
def test_force_xpctl_adds_label():
    gold = 'xpctl-label'
    input_ = {}
    force_xpctl(input_, gold)
    assert input_['reporting']['xpctl']['label'] == gold
Esempio n. 9
0
def test_force_xpctl_adds_both():
    input_ = {}
    force_xpctl(input_, None)
    assert 'reporting' in input_
    assert 'xpctl' in input_['reporting']
Esempio n. 10
0
def test_force_xpctl_adds_xpctl():
    input_ = {'reporting': {}}
    force_xpctl(input_, None)
    assert 'xpctl' in input_['reporting']
Esempio n. 11
0
def test_force_xpctl_adds_reporting():
    input_ = {}
    force_xpctl(input_, None)
    assert 'reporting' in input_
Esempio n. 12
0
def test_force_xpctl_skips_None():
    input_ = {}
    force_xpctl(input_, None)
    assert 'label' not in input_['reporting']['xpctl']