예제 #1
0
def test_setCommand(test_input, view):
    systemCommands(test_input, view)

    cmd = test_input.split()
    if len(cmd) == 3:
        assert view.cfg.get(cmd[1]) == cmd[2]
    else:
        assert view.cfg.deep_get(cmd[1], cmd[2]) == cmd[3]
예제 #2
0
    def routeCommand(self, cmd):
        self.preCommand()

        log.debug(cmd)

        if cmd.split()[0] not in (SystemCommandList + ChanCommandList +
                                  RedditCommandList + HNCommandList):
            return
        elif cmd.split()[0] in SystemCommandList:
            systemCommands(cmd, self.uvm)
        elif cmd.split()[0] in ChanCommandList:
            chanCommands(cmd, self.uvm)
        elif cmd.split()[0] in RedditCommandList:
            redditCommands(cmd, self.uvm)
        elif cmd.split()[0] in HNCommandList:
            hnCommands(cmd, self.uvm)

        self.postCommand()
예제 #3
0
def test_view(test_input, expected, view):
    systemCommands(test_input, view)
    assert type(view.currFocusView.frame) == expected[1]
예제 #4
0
def test_addReddit(test_input, expected, view):
    systemCommands(test_input, view)
    result = all(ex in view.cfg.deep_get(SITE.REDDIT, 'boards')
                 for ex in expected)
    assert result
예제 #5
0
def test_addChan(test_input, expected, view):
    systemCommands(test_input, view)
    result = all(ex in view.cfg.deep_get(SITE.FCHAN, 'boards')
                 for ex in expected)
    assert result
예제 #6
0
def test_quit(test_input, view):
    with pytest.raises(SystemExit) as wrapped_e:
        systemCommands(test_input, view)
    assert wrapped_e.type == SystemExit
예제 #7
0
def test_search(cmd, search, expected, view):
    systemCommands(cmd[0], view)
    systemCommands(cmd[1], view)
    systemCommands(search, view)
    assert type(view.currFocusView.frame) == expected[1]
예제 #8
0
def test_hist(cmd, history, expected, view):
    systemCommands(cmd[0], view)
    systemCommands(cmd[1], view)
    systemCommands(history, view)
    assert type(view.currFocusView.frame) == expected[1]
예제 #9
0
def test_source(source, expected, view, write_source_files):
    systemCommands(source, view)
    assert type(view.currFocusView.frame) == expected[1]