예제 #1
0
    def test_nonempty_set_object_is_not_empty_collection(self):

        x = {'@set': [5]}

        self.assertFalse(model.is_empty_collection(x))
예제 #2
0
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))
예제 #3
0
    def test_empty_set_object_is_empty_collection(self):

        x = {'@set': []}

        self.assertTrue(model.is_empty_collection(x))
예제 #4
0
    def test_list_with_only_null_is_empty(self):

        x = [None]

        self.assertTrue(model.is_empty_collection(x))
예제 #5
0
    def test_set_object_with_only_null_is_empty(self):

        x = {'@set': [None]}

        self.assertTrue(model.is_empty_collection(x))
예제 #6
0
    def test_scalar_is_not_empty_collection(self):

        self.assertFalse(model.is_empty_collection(2))
예제 #7
0
    def test_empty_array_is_empty_collection(self):

        self.assertTrue(model.is_empty_collection([]))