def test_nonempty_set_object_is_not_empty_collection(self): x = {'@set': [5]} self.assertFalse(model.is_empty_collection(x))
def opt_empty_collection(context): return functor.trans_values( lambda x: [], pred=lambda k, v: model.is_empty_collection(v) and (model.ldtype(k, v, context) is model.ldset or k in context.defns))
def test_empty_set_object_is_empty_collection(self): x = {'@set': []} self.assertTrue(model.is_empty_collection(x))
def test_list_with_only_null_is_empty(self): x = [None] self.assertTrue(model.is_empty_collection(x))
def test_set_object_with_only_null_is_empty(self): x = {'@set': [None]} self.assertTrue(model.is_empty_collection(x))
def test_scalar_is_not_empty_collection(self): self.assertFalse(model.is_empty_collection(2))
def test_empty_array_is_empty_collection(self): self.assertTrue(model.is_empty_collection([]))