Project

General

Profile

« Previous | Next » 

Revision a066af01

Added by koszko over 1 year ago

include $schema property in internally-generated resources/mappings

View differences:

test/haketilo_test/unit/test_payload_create.py
45 45
    'script':      sample_files['hello.js']['contents']
46 46
}
47 47

  
48
resource_schema_id, mapping_schema_id = [
49
    f'https://hydrilla.koszko.org/schemas/api_{t}_description-1.0.1.schema.json'
50
    for t in ('resource', 'mapping')
51
]
52

  
48 53
def fill_form_with_sample_data(execute_in_page, sample_data_override={},
49 54
                               form_ctx='form_ctx'):
50 55
    form_data = sample_form_data.copy()
......
128 133
                         for pat in form_data['patterns'].split('\n') if pat])
129 134

  
130 135
        assert db_contents['resource'] == [{
136
            '$schema':          resource_schema_id,
131 137
      	    'source_name':      localid,
132 138
	    'source_copyright': [],
133 139
	    'type':             'resource',
134 140
	    'identifier':       localid,
135 141
	    'uuid':             db_contents['resource'][0]['uuid'],
136 142
	    'version':          [1],
143
            'revision':         1,
137 144
	    'description':      form_data['description'],
138 145
	    'dependencies':     [],
139 146
            'long_name':        long_name,
......
145 152

  
146 153
        assert uuidv4_re.match(db_contents['mapping'][0]['uuid'])
147 154
        assert db_contents['mapping'] == [{
155
            '$schema':          mapping_schema_id,
148 156
      	    'source_name':      localid,
149 157
	    'source_copyright': [],
150 158
	    'type':             'mapping',

Also available in: Unified diff