Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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'
Exemplo n.º 4
0
 def test_normal(self, key, expected):
     """Test a special key where QKeyEvent::toString works incorrectly."""
     assert utils.key_to_string(key) == expected
Exemplo n.º 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
Exemplo n.º 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'
Exemplo n.º 7
0
 def test_normal(self, key, expected):
     """Test a special key where QKeyEvent::toString works incorrectly."""
     assert utils.key_to_string(key) == expected
Exemplo n.º 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