Add DUMAS resolution picker

This commit is contained in:
2026-10-21 16:21:07 +00:00
parent bd7568f628
commit 8e0bf05f08
5 changed files with 250 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import json
import unittest
import dumas_resolution_nodes as nodes
class DumasResolutionTests(unittest.TestCase):
def test_registers_dumas_resolution_node(self):
self.assertIn("DumasResolution", nodes.NODE_CLASS_MAPPINGS)
self.assertEqual(nodes.DumasResolutionNode.RETURN_NAMES, ("width", "height", "latent"))
self.assertIn("ResolutionState", nodes.DumasResolutionNode.INPUT_TYPES()["hidden"])
def test_resolution_state_is_clamped(self):
self.assertEqual(nodes.resolution_wh(json.dumps({"w": 32, "h": 20000})), (64, 16384))
def test_malformed_state_falls_back_to_default(self):
self.assertEqual(nodes.resolution_wh("not json"), (1024, 1024))
if __name__ == "__main__":
unittest.main()