Beispiel #1
0
 def test_manifest_filesystem(self):
     t_config = TConfig()
     t_config.PUBLIC_KEYS = ['bad key']
     t_config.DATA_DIR = os.getcwd()
     client = Client(t_config, refresh=True, test=True)
     filesystem_data = client._get_manifest_filesystem()
     filesystem_data = json.loads(filesystem_data)
     del filesystem_data['sigs']
     assert client.json_data == filesystem_data
Beispiel #2
0
    def test_callback(self):
        def cb(status):
            print(status)

        def cb2(status):
            raise IndexError

        t_config = TConfig()
        t_config.PUBLIC_KEYS = ['bad key']
        t_config.DATA_DIR = os.getcwd()
        client = Client(t_config, refresh=True, test=True, call_back=cb,
                        callbacks=[cb, cb2])
        client.add_call_back(cb2)
        assert client.update_check('jms', '0.0.0') is None
Beispiel #3
0
 def test_bad_pub_key(self, client):
     t_config = TConfig()
     t_config.PUBLIC_KEYS = ['bad key']
     t_config.DATA_DIR = os.getcwd()
     client = Client(t_config, refresh=True, test=True)
     assert client.update_check('jms', '0.0.0') is None