Exemplo n.º 1
0
def test_printer_composite_key():
    '''printer: key:key:value
       should be only two lines
    '''

    lines = scripts.printer({'key': {'key2': 'value'}}).split('\n')
    assert len(lines) == 2
Exemplo n.º 2
0
def test_simplevalue():
    """Test for simple value."""
    line = scripts.printer(1)
    # value passed should be represented by type in round parenthesis
    assert line == '1 (int)'
Exemplo n.º 3
0
def test_printer_list(configvalue, countlines):
    """Test printer: key:[value:value]."""
    lines = scripts.printer(configvalue).split('\n')
    # should be three lines. one for key, and two for list
    assert len(lines) == countlines
Exemplo n.º 4
0
def test_printer():
    """ printer: key:value pair
        Simple values should be placed in same line as key
    """
    lines = scripts.printer({'key': 'value'}).split('\n')
    assert len(lines) == 1
Exemplo n.º 5
0
def test_printer_two_keys_simple():
    '''printer: 2x key:value
       There are only two key:value pairs
    '''
    lines = scripts.printer({'key': 'value', 'key2': 'value'}).split('\n')
    assert len(lines) == 2