Exemplo n.º 1
0
    def test_nonempty_set_object_is_not_empty_collection(self):

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

        self.assertFalse(model.is_empty_collection(x))
Exemplo n.º 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))
Exemplo n.º 3
0
    def test_empty_set_object_is_empty_collection(self):

        x = {'@set': []}

        self.assertTrue(model.is_empty_collection(x))
Exemplo n.º 4
0
    def test_list_with_only_null_is_empty(self):

        x = [None]

        self.assertTrue(model.is_empty_collection(x))
Exemplo n.º 5
0
    def test_set_object_with_only_null_is_empty(self):

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

        self.assertTrue(model.is_empty_collection(x))
Exemplo n.º 6
0
    def test_scalar_is_not_empty_collection(self):

        self.assertFalse(model.is_empty_collection(2))
Exemplo n.º 7
0
    def test_empty_array_is_empty_collection(self):

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