Jeremiah Lowin commited on
Commit
dbd3581
·
1 Parent(s): 0f37c4b

Add test for missing annotation

Browse files
tests/utilities/test_func_metadata.py CHANGED
@@ -187,6 +187,18 @@ def test_keep_str_as_str():
187
  assert result["string"] == "{'nice to meet you': 'hello', 'goodbye': 5}"
188
 
189
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  def test_keep_str_union_as_str():
191
  """Test that string arguments are kept as strings"""
192
 
 
187
  assert result["string"] == "{'nice to meet you': 'hello', 'goodbye': 5}"
188
 
189
 
190
+ def test_missing_annotation():
191
+ """Test that missing annotations don't cause errors"""
192
+
193
+ def fn(x, y):
194
+ return x + y
195
+
196
+ meta = func_metadata(fn)
197
+ result = meta.pre_parse_json({"x": "1", "y": "2"})
198
+ assert result["x"] == "1"
199
+ assert result["y"] == "2"
200
+
201
+
202
  def test_keep_str_union_as_str():
203
  """Test that string arguments are kept as strings"""
204