mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
hound suggestions
This commit is contained in:
parent
9ff279d52f
commit
5c6a7b6b25
3 changed files with 21 additions and 11 deletions
|
|
@ -573,7 +573,10 @@ def convert_colorspace_enumerator_item(
|
|||
# raise exception if item is not found
|
||||
if not item_data:
|
||||
message_config_keys = ", ".join(
|
||||
"'{}':{}".format(key, set(config_items.get(key, {}).keys())) for key in config_items.keys()
|
||||
"'{}':{}".format(
|
||||
key,
|
||||
set(config_items.get(key, {}).keys())
|
||||
) for key in config_items.keys()
|
||||
)
|
||||
raise KeyError(
|
||||
"Missing colorspace item '{}' in config data: [{}]".format(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
from ast import alias
|
||||
import unittest
|
||||
from openpype.pipeline.colorspace import convert_colorspace_enumerator_item
|
||||
|
||||
|
|
@ -114,5 +113,6 @@ class TestConvertColorspaceEnumeratorItem(unittest.TestCase):
|
|||
with self.assertRaises(KeyError):
|
||||
convert_colorspace_enumerator_item("RGB::sRGB", config_items)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ class TestGetColorspacesEnumeratorItems(unittest.TestCase):
|
|||
self.assertEqual(result, expected)
|
||||
|
||||
def test_aliases(self):
|
||||
result = get_colorspaces_enumerator_items(self.config_items, include_aliases=True)
|
||||
result = get_colorspaces_enumerator_items(
|
||||
self.config_items, include_aliases=True)
|
||||
expected = [
|
||||
("colorspaces::Rec.709", "[colorspace] Rec.709"),
|
||||
("colorspaces::sRGB", "[colorspace] sRGB"),
|
||||
|
|
@ -56,7 +57,8 @@ class TestGetColorspacesEnumeratorItems(unittest.TestCase):
|
|||
self.assertEqual(result, expected)
|
||||
|
||||
def test_looks(self):
|
||||
result = get_colorspaces_enumerator_items(self.config_items, include_looks=True)
|
||||
result = get_colorspaces_enumerator_items(
|
||||
self.config_items, include_looks=True)
|
||||
expected = [
|
||||
("colorspaces::Rec.709", "[colorspace] Rec.709"),
|
||||
("colorspaces::sRGB", "[colorspace] sRGB"),
|
||||
|
|
@ -65,20 +67,22 @@ class TestGetColorspacesEnumeratorItems(unittest.TestCase):
|
|||
self.assertEqual(result, expected)
|
||||
|
||||
def test_display_views(self):
|
||||
result = get_colorspaces_enumerator_items(self.config_items, include_display_views=True)
|
||||
result = get_colorspaces_enumerator_items(
|
||||
self.config_items, include_display_views=True)
|
||||
expected = [
|
||||
("colorspaces::Rec.709", "[colorspace] Rec.709"),
|
||||
("colorspaces::sRGB", "[colorspace] sRGB"),
|
||||
("displays_views::Rec.709 (ACES)", "[view (display)] Rec.709 (ACES)"),
|
||||
("displays_views::Rec.709 (ACES)", "[view (display)] Rec.709 (ACES)"), # noqa: E501
|
||||
("displays_views::sRGB (ACES)", "[view (display)] sRGB (ACES)"),
|
||||
|
||||
]
|
||||
self.assertEqual(result, expected)
|
||||
|
||||
def test_roles(self):
|
||||
result = get_colorspaces_enumerator_items(self.config_items, include_roles=True)
|
||||
result = get_colorspaces_enumerator_items(
|
||||
self.config_items, include_roles=True)
|
||||
expected = [
|
||||
("roles::compositing_linear", "[role] compositing_linear (linear)"),
|
||||
("roles::compositing_linear", "[role] compositing_linear (linear)"), # noqa: E501
|
||||
("colorspaces::Rec.709", "[colorspace] Rec.709"),
|
||||
("colorspaces::sRGB", "[colorspace] sRGB"),
|
||||
]
|
||||
|
|
@ -86,7 +90,10 @@ class TestGetColorspacesEnumeratorItems(unittest.TestCase):
|
|||
|
||||
def test_all(self):
|
||||
message_config_keys = ", ".join(
|
||||
"'{}':{}".format(key, set(self.config_items.get(key, {}).keys())) for key in self.config_items.keys()
|
||||
"'{}':{}".format(
|
||||
key,
|
||||
set(self.config_items.get(key, {}).keys())
|
||||
) for key in self.config_items.keys()
|
||||
)
|
||||
print("Testing with config: [{}]".format(message_config_keys))
|
||||
result = get_colorspaces_enumerator_items(
|
||||
|
|
@ -97,14 +104,14 @@ class TestGetColorspacesEnumeratorItems(unittest.TestCase):
|
|||
include_display_views=True,
|
||||
)
|
||||
expected = [
|
||||
("roles::compositing_linear", "[role] compositing_linear (linear)"),
|
||||
("roles::compositing_linear", "[role] compositing_linear (linear)"), # noqa: E501
|
||||
("colorspaces::Rec.709", "[colorspace] Rec.709"),
|
||||
("colorspaces::sRGB", "[colorspace] sRGB"),
|
||||
("aliases::rec709_1", "[alias] rec709_1 (Rec.709)"),
|
||||
("aliases::rec709_2", "[alias] rec709_2 (Rec.709)"),
|
||||
("aliases::sRGB_1", "[alias] sRGB_1 (sRGB)"),
|
||||
("looks::sRGB_to_Rec.709", "[look] sRGB_to_Rec.709 (sRGB)"),
|
||||
("displays_views::Rec.709 (ACES)", "[view (display)] Rec.709 (ACES)"),
|
||||
("displays_views::Rec.709 (ACES)", "[view (display)] Rec.709 (ACES)"), # noqa: E501
|
||||
("displays_views::sRGB (ACES)", "[view (display)] sRGB (ACES)"),
|
||||
]
|
||||
self.assertEqual(result, expected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue