skrawcz commented on code in PR #656:
URL: https://github.com/apache/burr/pull/656#discussion_r2836507140


##########
tests/core/test_action_reads_linter.py:
##########
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements...
+
+
+import pytest
+from burr.core.action import action
+from burr.core.state import State
+
+
+def test_undeclared_state_read_raises_error():
+    with pytest.raises(ValueError):
+
+        @action(reads=["foo"], writes=[])
+        def bad_action(state: State):
+            x = state["bar"]
+            return {}, state
+
+
+def test_declared_state_read_passes():
+    @action(reads=["foo"], writes=[])
+    def good_action(state: State):
+        x = state["foo"]
+        return {}, state

Review Comment:
   can you add a test for multiple missing keys interleaved with non-missing 
keys please?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to