SG-33057 App pre-commit configuration and CI #367
Merged
Azure Pipelines / shotgunsoftware.python-api
succeeded
Feb 12, 2025 in 3m 30s
Build #20250212.2 had test failures
Details
- Failed: 1 (0.04%)
- Passed: 2,742 (99.96%)
- Other: 0 (0.00%)
- Total: 2,743
- 1460 of 1947 lines covered (74.99%)
Annotations
azure-pipelines / shotgunsoftware.python-api
tests/test_api.py::TestReadAdditionalFilterPresets::test_modify_visibility
self = <tests.test_api.TestReadAdditionalFilterPresets testMethod=test_modify_visibility>
def test_modify_visibility(self):
"""
Ensure the visibility of a field can be edited via the API.
"""
# If the version of Shotgun is too old, do not run this test.
# TODO: Update this with the real version number once the feature is released.
if self.sg_version < (8, 5, 0):
warnings.warn(
"Test bypassed because PTR server used does not support this feature.",
FutureWarning,
)
return
field_display_name = "Project Visibility Test"
field_name = "sg_{0}".format(field_display_name.lower().replace(" ", "_"))
schema = self.sg.schema_field_read("Asset")
# Ensure the custom field exists.
if field_name not in schema:
self.sg.schema_field_create("Asset", "text", "Project Visibility Test")
# Grab any two projects that we can use for toggling the visible property with.
projects = self.sg.find(
"Project", [], order=[{"field_name": "id", "direction": "asc"}]
)
project_1 = projects[0]
project_2 = projects[1]
# First, reset the field visibility in a known state, i.e. visible for both projects,
# in case the last test run failed midway through.
self.sg.schema_field_update("Asset", field_name, {"visible": True}, project_1)
> self.assertEqual(
{"value": True, "editable": True},
self.sg.schema_field_read("Asset", field_name, project_1)[field_name][
"visible"
],
)
E AssertionError: {'value': True, 'editable': True} != {'value': False, 'editable': True}
E - {'editable': True, 'value': True}
E ? ^^^
E
E + {'editable': True, 'value': False}
E ? ^^^^
tests/test_api.py:3403: AssertionError
Raw output
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/unittest/case.py:675: AssertionError: {'value': True, 'editable': True} != {'value': False, 'editable': True}
Loading