def test_not_field(): field = NotField(a) assert set(field.iter_all_fields()) == set([a]) field = NotField(Var({ 'a': a, 'b': b, 'c': None, # probably should raise? })) assert set(field.iter_all_fields()) == set([a, b])
def test_not_field(): field = NotField(a) assert set(field.iter_all_fields()) == set([a]) assert set(field.iter_fields('some_role')) == set([a]) field = NotField(Var({ 'role_1': a, 'role_2': b, 'role_3': None, # probably should raise? })) assert set(field.iter_all_fields()) == set([a, b]) assert set(field.iter_fields('role_1')) == set([a]) assert set(field.iter_fields('role_3')) == set([])
def test_not_field(): field = NotField(a) assert set(field.iter_all_fields()) == set([a]) field = NotField( Var({ 'a': a, 'b': b, 'c': None, # probably should raise? })) assert set(field.iter_all_fields()) == set([a, b])
def test_not_field(): field = NotField(a) assert set(field.iter_fields()) == set([a]) assert set(field.resolve_and_iter_fields('some_role')) == set([a]) field = NotField(Var({ 'role_1': a, 'role_2': b, 'role_3': None, # probably should raise? })) assert set(field.iter_fields()) == set([a, b]) assert set(field.resolve_and_iter_fields('role_1')) == set([a]) assert set(field.resolve_and_iter_fields('role_3')) == set([])
def test_not_field(): s_f = StringField() field = NotField(Var({'role_1': s_f})) assert field.get_schema() == {'not': {}} assert field.get_schema(role='role_1') == {'not': s_f.get_schema()}