Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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'
Пример #4
0
 def test_normal(self, key, expected):
     """Test a special key where QKeyEvent::toString works incorrectly."""
     assert utils.key_to_string(key) == expected
Пример #5
0
 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
Пример #6
0
 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'
Пример #7
0
 def test_normal(self, key, expected):
     """Test a special key where QKeyEvent::toString works incorrectly."""
     assert utils.key_to_string(key) == expected
Пример #8
0
 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