def test_checkpypi_raise_exception(self, get, LOG): get.side_effect = KeyError check_pypi_version() self.assertIn("Unable to", LOG.critical.call_args_list[0][0][0])
def test_checkpypi_new_release(self, get, LOG): get.return_value = Mock(json=lambda: {'info': {'version': '0.0'}}) check_pypi_version() self.assertIn("You are using subscope version", LOG.warn.call_args_list[0][0][0])
def test_checkpypi_same(self, get, LOG): get.return_value = \ Mock(json=lambda: {'info': {'version': __version__}}) check_pypi_version() self.assertFalse(LOG.warn.called) self.assertFalse(LOG.critical.called)