Add AR, AG, AB test case and fix behavior

This commit is contained in:
Roy Nieterau 2025-05-19 12:04:01 +02:00
parent 526e5bfabb
commit 5917671521
2 changed files with 24 additions and 1 deletions

View file

@ -389,7 +389,7 @@ def get_review_info_by_layer_name(channel_names):
layer_names_order.append(layer_name)
# R, G, B, A or X, Y, Z, N, AR, AG, AB
channel = last_part[0].upper()
channel = last_part.upper()
channels_by_layer_name[layer_name][channel] = channel_name
# Put empty layer to the beginning of the list

View file

@ -82,6 +82,29 @@ class GetReviewInfoByLayerName(unittest.TestCase):
}
}])
def test_ar_ag_ab_channels(self):
info = get_review_info_by_layer_name(["AR", "AG", "AB"])
self.assertEqual(info, [{
"name": "",
"review_channels": {
"R": "AR",
"G": "AG",
"B": "AB",
"A": None,
}
}])
info = get_review_info_by_layer_name(["AR", "AG", "AB", "A"])
self.assertEqual(info, [{
"name": "",
"review_channels": {
"R": "AR",
"G": "AG",
"B": "AB",
"A": "A",
}
}])
def test_unknown_channels(self):
info = get_review_info_by_layer_name(["hello", "world"])