Пример #1
0
def test_restart_get_text():
    frr = MagicMock()
    frr.get_config = MagicMock(return_value="""!
 text1
 ! comment
 text2
 text3
 ! comment
 text4
    """)
    c = ConfigMgr(frr)
    c.update()
    assert c.get_text() == [
        ' text1', ' text2', ' text3', ' text4', '    ', '     '
    ]
Пример #2
0
def test_update():
    frr = MagicMock()
    frr.get_config = MagicMock(return_value="""!
 text1
 ! comment
 text2
 text3
 ! comment
 text4
    """)
    c = ConfigMgr(frr)
    c.update()
    assert c.current_config_raw == [
        ' text1', ' text2', ' text3', ' text4', '    ', '     '
    ]
    assert c.current_config == [['text1'], ['text2'], ['text3'], ['text4']]