Ejemplo n.º 1
0
    def test_extended_relation(self):
        loadBLMs([('a', aBlm), ('b', bBlm), ('c', cBlm)])

        import blm, blm.a, blm.b, blm.c

        assert blm.a.A.b.related is blm.b.B.a
        assert blm.b.B.a.related is blm.a.A.b
Ejemplo n.º 2
0
    def test_bson(self):
        loadBLMs([('fooBlm', fooBlm)])

        to = blm.fooBlm.FooToc()

        son = bson.BSON.encode({'toi': to})
        decoded = son.decode()

        assert decoded['toi'].__class__ == blm.fooBlm.FooToc
        assert decoded['toi'].id == to.id
Ejemplo n.º 3
0
    def setup_method(self, method):
        import blm.fundamental
        loadBLMs([('relBlm', relBlm)])
        super(TestRelationRestrictions_etc, self).setup_method(method)

        import blm

        self.parent = blm.relBlm.Parent()
        self.child  = blm.relBlm.Child (parent=[self.parent])
        self.queen  = blm.relBlm.Parent()
        self.prince = blm.relBlm.Child (parent=[self.queen])
        self.nurse  = blm.relBlm.Nurse ()
        self.baby   = blm.relBlm.Orphan(parent=[self.nurse])
        self.orphan = blm.relBlm.Orphan()
        self.lisa   = blm.relBlm.Baby()
        self.mom    = blm.relBlm.Mom (children=[self.lisa])
        self.commit()
Ejemplo n.º 4
0
def setup_module(module):
    from blm import fundamental
    loadBLMs([('fake', fake)])
Ejemplo n.º 5
0
 def setup_method(self, method):
     super(TestStructure, self).setup_method(method)
     import blm, blm.fundamental
     loadBLMs([('fooBlm', fooBlm), ('barBlm', barBlm), ('zooBlm', zooBlm)])
Ejemplo n.º 6
0
    def test_annotateBlmForRelations(self):
        loadBLMs([('fundamental', baseBlm), ('fooBlm', fooBlm),
                  ('barBlm', barBlm)])

        assert blm.barBlm.Foo.subParts.related is blm.fooBlm.MIMEPart.superPart