Project

General

Profile

« Previous | Next » 

Revision 72553a2d

Added by koszko over 1 year ago

assume and use "$schema" properties in item definitions

View differences:

test/unit/test_install.py
197 197
    'HTTP_code_item',
198 198
    'invalid_JSON',
199 199
    'newer_API_version',
200
    'invalid_API_version',
200
    'invalid_response_format',
201 201
    'indexeddb_error_item',
202 202
    'installing',
203 203
    'indexeddb_error_file_uses',
......
285 285
            const response = {
286 286
                ok: true,
287 287
                status: 200,
288
                json: {api_schema_version: [99, 99]}
288
                json: {$schema: "https://hydrilla.koszko.org/schemas/api_mapping_description-2.1.schema.json"}
289 289
            };
290 290
            browser.tabs.sendMessage = () => Promise.resolve(response);
291 291
            install_view.show(...arguments);
......
293 293
            'https://hydril.la/', 'mapping', 'somemapping', [2, 1])
294 294

  
295 295
        assert_dlg(['conf_buts'],
296
                   'Mapping somemapping-2.1 was served using unsupported Hydrilla API version (99.99). You might need to update Haketilo.')
297
    elif message == 'invalid_API_version':
296
                   'Mapping somemapping-2.1 was served using unsupported Hydrilla API version. You might need to update Haketilo.')
297
    elif message == 'invalid_response_format':
298 298
        execute_in_page(
299 299
            '''
300 300
            const response = {
301 301
                ok: true,
302 302
                status: 200,
303
                /* API version here is not an array as it should be. */
304
                json: {api_schema_version: 123}
303
                /* $schema is not a string as it should be. */
304
                json: {$schema: null}
305 305
            };
306 306
            browser.tabs.sendMessage = () => Promise.resolve(response);
307 307
            install_view.show(...arguments);
......
309 309
            'https://hydril.la/', 'resource', 'someresource')
310 310

  
311 311
        assert_dlg(['conf_buts'],
312
                   'Resource someresource was served using unsupported Hydrilla API version. You might need to update Haketilo.')
312
                   'Resource someresource was served using a nonconforming response format.')
313 313
    elif message == 'indexeddb_error_item':
314 314
        execute_in_page(
315 315
            '''

Also available in: Unified diff