Permissions: change from list to key/value pairs in manifest #168
BIN
extensions/tests/files/addon-with-permissions.zip
Normal file
BIN
extensions/tests/files/addon-with-permissions.zip
Normal file
Binary file not shown.
@ -63,6 +63,22 @@ EXPECTED_EXTENSION_DATA = {
|
|||||||
'version_str': '1.0.8',
|
'version_str': '1.0.8',
|
||||||
'slug': 'amaranth',
|
'slug': 'amaranth',
|
||||||
},
|
},
|
||||||
|
'addon-with-permissions.zip': {
|
||||||
|
'metadata': {
|
||||||
|
'tagline': 'Some add-on tag line',
|
||||||
|
'name': 'Some Add-on',
|
||||||
|
'id': 'some_addon',
|
||||||
|
'version': '0.1.0',
|
||||||
|
'blender_version_min': '4.2.0',
|
||||||
|
'type': 'add-on',
|
||||||
|
'permissions': {'files': 'reading files', 'network': 'talking to server'},
|
||||||
|
},
|
||||||
|
'file_hash': 'sha256:cce5f6268cb096cf8b070b17cab78ad2bc10f2ff85c625ef4a2b6db7c01a29ad',
|
||||||
|
'size_bytes': 748,
|
||||||
|
'tags': [],
|
||||||
|
'version_str': '0.1.0',
|
||||||
|
'slug': 'some-addon',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
EXPECTED_VALIDATION_ERRORS = {
|
EXPECTED_VALIDATION_ERRORS = {
|
||||||
'empty.txt': {'source': ['Only .zip files are accepted.']},
|
'empty.txt': {'source': ['Only .zip files are accepted.']},
|
||||||
@ -147,6 +163,7 @@ class SubmitFileTest(TestCase):
|
|||||||
self.assertEqual(file.hash, file_hash)
|
self.assertEqual(file.hash, file_hash)
|
||||||
self.assertEqual(file.get_type_display(), 'Add-on')
|
self.assertEqual(file.get_type_display(), 'Add-on')
|
||||||
self.assertEqual(file.metadata['version'], version_str)
|
self.assertEqual(file.metadata['version'], version_str)
|
||||||
|
self.assertEqual(file.metadata.get('permissions'), other_metadata.get('permissions'))
|
||||||
|
|
||||||
def test_not_allowed_anonymous(self):
|
def test_not_allowed_anonymous(self):
|
||||||
with open(TEST_FILES_DIR / 'edit_breakdown-0.1.0.zip', 'rb') as fp:
|
with open(TEST_FILES_DIR / 'edit_breakdown-0.1.0.zip', 'rb') as fp:
|
||||||
|
Loading…
Reference in New Issue
Block a user