File size: 8,483 Bytes
d61821a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | {
"commit": "8c1aaa3f6a797caf7bd79a7da083eae56c6250ff",
"parent": "f4f7d7a63716f072eb45db2c7f590db0435350f0",
"repository_id": "R003",
"schema_version": 1,
"task_id": "TASK_S2_R003_005",
"valid_end_to_end": true,
"validation": {
"commands": [
"python -m pytest -q tests/unit/objects"
],
"elapsed_seconds": 1.568030667025596,
"gold": [
{
"command": "python -m pytest -q tests/unit/objects",
"elapsed_seconds": 0.44028154108673334,
"returncode": 0,
"stderr": "",
"stdout": "....................................................................s..s [ 20%]\n........................................................................ [ 41%]\n........................................................................ [ 61%]\n...s.................................................................... [ 82%]\n............................................................... [100%]\n348 passed, 3 skipped in 0.27s\n",
"timed_out": false
}
],
"hidden": [
{
"command": "python -m pytest -q tests/unit/objects",
"elapsed_seconds": 0.4887023330666125,
"returncode": 1,
"stderr": "",
"stdout": "because we are not able to detect changes made on the object\n # (append, insert, pop, ...). Without forcing the attr\n # creation __setattr__ is never called, the list never ends up\n # in the _updated_attrs dict, and the update() and save()\n # method never push the new data to the server.\n # See https://github.com/python-gitlab/python-gitlab/issues/306\n #\n # note: _parent_attrs will only store simple values (int) so we\n # don't make this check in the next block.\n if isinstance(value, list):\n self.__dict__[\"_updated_attrs\"][name] = value[:]\n return self.__dict__[\"_updated_attrs\"][name]\n \n return value\n \n if name in self.__dict__[\"_parent_attrs\"]:\n return self.__dict__[\"_parent_attrs\"][name]\n \n message = f\"{type(self).__name__!r} object has no attribute {name!r}\"\n if self._created_from_list:\n message = (\n f\"{message}\\n\\n\"\n + textwrap.fill(\n f\"{self.__class__!r} was created via a list() call and \"\n f\"only a subset of the data may be present. To ensure \"\n f\"all data is present get the object using a \"\n f\"get(object.id) call. For more details, see:\"\n )\n + f\"\\n\\n{_URL_ATTRIBUTE_ERROR}\"\n )\n elif self._lazy:\n message = f\"{message}\\n\\n\" + textwrap.fill(\n f\"If you tried to access object attributes returned from the server, \"\n f\"note that {self.__class__!r} was created as a `lazy` object and was \"\n f\"not initialized with any data.\"\n )\n> raise AttributeError(message)\nE AttributeError: 'Project' object has no attribute 'registry_protection_repository_rules'\nE \nE If you tried to access object attributes returned from the server,\nE note that <class 'gitlab.v4.objects.projects.Project'> was created as\nE a `lazy` object and was not initialized with any data.\n\ngitlab/base.py:134: AttributeError\n____________________ test_update_project_protected_registry ____________________\n\nproject = <Project id:1>\nresp_update_protected_registry = <responses.RequestsMock object at 0x10bd5a8d0>\n\n def test_update_project_protected_registry(project, resp_update_protected_registry):\n> updated = project.registry_protection_repository_rules.update(\n 1, {\"repository_path_pattern\": \"abc*\"}\n )\n\ntests/unit/objects/test_registry_protection_rules.py:79: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Project id:1>, name = 'registry_protection_repository_rules'\n\n def __getattr__(self, name: str) -> Any:\n if name in self.__dict__[\"_updated_attrs\"]:\n return self.__dict__[\"_updated_attrs\"][name]\n \n if name in self.__dict__[\"_attrs\"]:\n value = self.__dict__[\"_attrs\"][name]\n # If the value is a list, we copy it in the _updated_attrs dict\n # because we are not able to detect changes made on the object\n # (append, insert, pop, ...). Without forcing the attr\n # creation __setattr__ is never called, the list never ends up\n # in the _updated_attrs dict, and the update() and save()\n # method never push the new data to the server.\n # See https://github.com/python-gitlab/python-gitlab/issues/306\n #\n # note: _parent_attrs will only store simple values (int) so we\n # don't make this check in the next block.\n if isinstance(value, list):\n self.__dict__[\"_updated_attrs\"][name] = value[:]\n return self.__dict__[\"_updated_attrs\"][name]\n \n return value\n \n if name in self.__dict__[\"_parent_attrs\"]:\n return self.__dict__[\"_parent_attrs\"][name]\n \n message = f\"{type(self).__name__!r} object has no attribute {name!r}\"\n if self._created_from_list:\n message = (\n f\"{message}\\n\\n\"\n + textwrap.fill(\n f\"{self.__class__!r} was created via a list() call and \"\n f\"only a subset of the data may be present. To ensure \"\n f\"all data is present get the object using a \"\n f\"get(object.id) call. For more details, see:\"\n )\n + f\"\\n\\n{_URL_ATTRIBUTE_ERROR}\"\n )\n elif self._lazy:\n message = f\"{message}\\n\\n\" + textwrap.fill(\n f\"If you tried to access object attributes returned from the server, \"\n f\"note that {self.__class__!r} was created as a `lazy` object and was \"\n f\"not initialized with any data.\"\n )\n> raise AttributeError(message)\nE AttributeError: 'Project' object has no attribute 'registry_protection_repository_rules'\nE \nE If you tried to access object attributes returned from the server,\nE note that <class 'gitlab.v4.objects.projects.Project'> was created as\nE a `lazy` object and was not initialized with any data.\n\ngitlab/base.py:134: AttributeError\n=========================== short test summary info ============================\nFAILED tests/unit/objects/test_registry_protection_rules.py::test_list_project_protected_registries\nFAILED tests/unit/objects/test_registry_protection_rules.py::test_create_project_protected_registry\nFAILED tests/unit/objects/test_registry_protection_rules.py::test_update_project_protected_registry\nERROR tests/unit/objects/test_registry_protection_rules.py::test_list_project_protected_registries\nERROR tests/unit/objects/test_registry_protection_rules.py::test_create_project_protected_registry\nERROR tests/unit/objects/test_registry_protection_rules.py::test_update_project_protected_registry\n3 failed, 345 passed, 3 skipped, 3 errors in 0.32s\n",
"timed_out": false
}
],
"hidden_apply": {
"elapsed_seconds": 0.009433583123609424,
"returncode": 0,
"stderr": "",
"stdout": ""
},
"original": [
{
"command": "python -m pytest -q tests/unit/objects",
"elapsed_seconds": 0.5756600829772651,
"returncode": 0,
"stderr": "",
"stdout": "....................................................................s..s [ 20%]\n........................................................................ [ 41%]\n........................................................................ [ 61%]\n...s.................................................................... [ 82%]\n............................................................... [100%]\n348 passed, 3 skipped in 0.40s\n",
"timed_out": false
}
],
"reason": null,
"source_apply": {
"elapsed_seconds": 0.009936083108186722,
"returncode": 0,
"stderr": "",
"stdout": ""
},
"valid": true
}
}
|