Adding general test coverage.

This commit is contained in:
Michael Lazar
2016-08-10 01:32:02 -07:00
parent c096d7014c
commit 17425008b3
7 changed files with 1079 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
import time
import curses
from collections import OrderedDict
import six
import pytest
@@ -314,7 +315,13 @@ def test_objects_controller_command():
ControllerA.character_map = {Command('REFRESH'): 0, Command('UPVOTE'): 0}
# A double command can't share the first key with a single comand
keymap = KeyMap({'REFRESH': ['gg'], 'UPVOTE': ['g']})
keymap = KeyMap(OrderedDict([('REFRESH', ['gg']), ('UPVOTE', ['g'])]))
with pytest.raises(exceptions.ConfigError) as e:
ControllerA(None, keymap=keymap)
assert 'ControllerA' in six.text_type(e)
# It doesn't matter which order they were entered
keymap = KeyMap(OrderedDict([('UPVOTE', ['g']), ('REFRESH', ['gg'])]))
with pytest.raises(exceptions.ConfigError) as e:
ControllerA(None, keymap=keymap)
assert 'ControllerA' in six.text_type(e)