예제 #1
0
def test_with_wrong_overflow_type(num, overflow, error_type):
    """Test overflow_format with wrong """
    with pytest.raises(ValueError) as exc_info:
        utils.overflow_format(num, overflow)

    exception_msg = exc_info.value.args[0]
    assert exception_msg == "Input argument 'overflow' should be int type, " \
                            "but get <type '{}'>".format(error_type)
예제 #2
0
def test_overflow_format(num, overflow, result):
    """Test overflow_format with normal arg."""
    assert utils.overflow_format(num, overflow) == result
예제 #3
0
 def _update_number(self):
     self._badge_button.setText(utils.overflow_format(self._count, self._overflow_count))
     self._badge_button.setVisible(self._count > 0)
     self._dot = None
     self.style().polish(self)