@@ -81,6 +81,7 @@ def test_edmx(schema):
81
81
assert master_prop_data .text_proprty .name == 'DataName'
82
82
assert master_prop_data .visible
83
83
assert master_prop_data .max_length == StructTypeProperty .MAXIMUM_LENGTH
84
+ assert master_prop_data .nullable == False
84
85
85
86
master_prop_data_vh = master_prop_data .value_helper
86
87
assert str (master_prop_data_vh ) == 'ValueHelper(MasterEntity/Data)'
@@ -147,6 +148,19 @@ def test_edmx(schema):
147
148
assert typ_ex_info .value .args [0 ] == 'Type FooBar does not exist in Schema Namespace EXAMPLE_SRV'
148
149
149
150
151
+ def test_schema_entity_type_nullable (schema ):
152
+ emp_entity = schema .entity_type ('Employee' )
153
+
154
+ id_property = emp_entity .proprty ('ID' )
155
+ assert id_property .nullable == False
156
+
157
+ firstname_property = emp_entity .proprty ('NameFirst' )
158
+ assert firstname_property .nullable == True
159
+
160
+ nickname_property = emp_entity .proprty ('NickName' )
161
+ assert nickname_property .nullable == True
162
+
163
+
150
164
def test_schema_entity_sets (schema ):
151
165
"""Test Schema methods for EntitySets"""
152
166
@@ -282,12 +296,18 @@ def test_edmx_function_imports(schema):
282
296
assert str (param ) == 'FunctionImportParameter(Param)'
283
297
assert param .name == 'Param'
284
298
assert param .typ .name == 'Edm.String'
285
- assert not param .nullable
299
+ assert param .nullable
286
300
assert param .max_length is None
287
301
assert param .mode == 'In'
288
302
assert param .typ .traits .to_literal ('Foo' ) == "'Foo'"
289
303
assert param .typ .traits .from_literal ("'Foo'" ) == 'Foo'
290
304
305
+ param_non_null = function_import .parameters [1 ]
306
+ assert param_non_null .nullable == False
307
+
308
+ param_null = function_import .parameters [2 ]
309
+ assert param_null .nullable == True
310
+
291
311
# function import without return type
292
312
function_import = schema .function_import ('refresh' )
293
313
assert function_import .return_type is None
0 commit comments