def test_bad_pub_key(self): t_config = TConfig() # If changed ensure it's a valid key format t_config.PUBLIC_KEY = '25RSdhJ+xCsxxTjY5jffilatipp29tnKp/D5BelSMJM' t_config.DATA_DIR = os.getcwd() client = Client(t_config, refresh=True, test=True) assert client.update_check(client.app_name, '0.0.0') is None
def test_callback(self): def cb(status): print(status) def cb2(status): raise IndexError t_config = TConfig() t_config.PUBLIC_KEY = '25RSdhJ+xCsxxTjY5jffilatipp29tnKp/D5BelSMJM' t_config.DATA_DIR = os.getcwd() client = Client(t_config, refresh=True, test=True, progress_hooks=[cb]) client.add_progress_hook(cb2) assert client.update_check(client.app_name, '0.0.0') is None
def test_bad_pub_key(): config = TConfig() config.PUBLIC_KEY = 'bad key' client = Client(config, test=True) assert client.update_check(u'jms', '0.0.0') is False