paula: removed old per-repo trunk subdirs
[paula.git] / paula.properties / src / paula / properties / README.txt
blobc9650fdc00055a8b77e6ed5827968432261b4c1f
1 Currently unused
4 paula.properties Package Readme
5 ===============================
7 XXX: eventually we just test this inside of paula.suite or wherever we do
8 the overall testing, it is way to bothersome to do it here...
10 Create two PAU's
12     >>> from zope.app.authentication
16 test whether properties end up on principals created by a PAU
19 nested
21 two principals with the same name
23 two provider on one level for the same principal
25 another provider for another principal
30     A mockup principal
32         >>> p = Mock(id='1')
34     A mockup property provider
36         >>> class IA(Interface):
37         ...     a1 = Attribute(u"a1")
38         ...     a2 = Attribute(u"a2")
39         >>> alsoProvides(IA, IPropertyInterface)
41         >>> class IB(Interface):
42         ...     b = Attribute(u"b")
43         >>> alsoProvides(IB, IPropertyInterface)
45         >>> class IC(Interface):
46         ...     c = Attribute(u"c")
48         >>> pp1 = Mock(
49         ...         a1=1,
50         ...         a2=2,
51         ...         b=3,
52         ...         c='not copied',
53         ...         alsoProvides=(IA,IB),
54         ...         )
56     And another one
58         >>> class ID(Interface):
59         ...     d = Attribute(u"d")
60         >>> alsoProvides(ID, IPropertyInterface)
62         >>> pp2 = Mock(d=4, alsoProvides=(ID,))
64     A mockup property provider utility
66         >>> import UserDict
67         >>> ppu = UserDict.UserDict()
68         >>> ppu["1"] = [pp1, pp2]
70     Call and check which attributes made it
72         >>> _copy_attributes_from_ppu(p, ppu)
73         >>> IA.providedBy(p)
74         True
75         >>> IB.providedBy(p)
76         True
77         >>> IC.providedBy(p)
78         False
79         >>> ID.providedBy(p)
80         True
81         >>> p.a1
82         1
83         >>> p.a2
84         2
85         >>> p.b
86         3
87         >>> getattr(p, 'c', 'foo')
88         'foo'
89         >>> p.d
90         4