def test_all(self): """Make sure there's some sensible output for all keys.""" for name, value in sorted(vars(Qt).items()): if not isinstance(value, Qt.Key): continue print(name) string = utils.key_to_string(value) assert string string.encode('utf-8') # make sure it's encodable
def test_missing(self, monkeypatch): """Test with a missing key.""" monkeypatch.delattr(utils.Qt, 'Key_Blue') # We don't want to test the key which is actually missing - we only # want to know if the mapping still behaves properly. assert utils.key_to_string(Qt.Key_A) == 'A'
def test_normal(self, key, expected): """Test a special key where QKeyEvent::toString works incorrectly.""" assert utils.key_to_string(key) == expected
def test_all(self, key): """Make sure there's some sensible output for all keys.""" string = utils.key_to_string(key) assert string string.encode("utf-8") # make sure it's encodable
def test_all(self, key): """Make sure there's some sensible output for all keys.""" string = utils.key_to_string(key) assert string string.encode('utf-8') # make sure it's encodable