• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gocept / gocept.reference / 6523922481

10 Oct 2023 06:21AM UTC coverage: 98.387%. Remained the same
6523922481

push

github

icemac
[pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0)

162 of 169 branches covered (0.0%)

Branch coverage included in aggregate %.

509 of 513 relevant lines covered (99.22%)

0.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/gocept/reference/testing.py
1
import doctest
1✔
2
import gocept.reference
1✔
3
import os.path
1✔
4
import zope.annotation.interfaces
1✔
5
import zope.app.testing.functional
1✔
6
import zope.container.contained
1✔
7
import zope.interface
1✔
8

9

10
ftesting_zcml = os.path.join(os.path.dirname(__file__), 'ftesting.zcml')
1✔
11
FunctionalLayer = zope.app.testing.functional.ZCMLLayer(
1✔
12
    ftesting_zcml, __name__, 'FunctionalLayer')
13
FunctionalLayer.allow_teardown = True
1✔
14

15

16
def FunctionalDocFileSuite(*paths, **kw):
1✔
17
    kw['optionflags'] = (kw.get('optionflags', 0) |
1✔
18
                         doctest.ELLIPSIS |
19
                         doctest.NORMALIZE_WHITESPACE)
20
    suite = zope.app.testing.functional.FunctionalDocFileSuite(*paths, **kw)
1✔
21
    suite.layer = FunctionalLayer
1✔
22
    return suite
1✔
23

24

25
class TestCase(zope.app.testing.functional.FunctionalTestCase):
1✔
26
    """Basic functional test case with zcml loaded."""
27

28
    layer = FunctionalLayer
1✔
29

30

31
@zope.interface.implementer(
1✔
32
    zope.annotation.interfaces.IAttributeAnnotatable)
33
class Address(zope.container.contained.Contained):
1✔
34

35
    city = gocept.reference.Reference()
1✔
36

37

38
@zope.interface.implementer(
1✔
39
    zope.annotation.interfaces.IAttributeAnnotatable)
40
class City(zope.container.contained.Contained):
1✔
41

42
    cultural_institutions = gocept.reference.ReferenceCollection(
1✔
43
        ensure_integrity=True)
44

45

46
@zope.interface.implementer(
1✔
47
    zope.annotation.interfaces.IAttributeAnnotatable)
48
class Village(zope.container.contained.Contained):
1✔
49

50
    cultural_institutions = gocept.reference.ReferenceCollection(
1✔
51
        ensure_integrity=False)
52

53

54
@zope.interface.implementer(
1✔
55
    zope.annotation.interfaces.IAttributeAnnotatable)
56
class Monument(zope.container.contained.Contained):
1✔
57

58
    city = gocept.reference.Reference(ensure_integrity=True)
1✔
59

60

61
class CulturalInstitution(zope.container.contained.Contained):
1✔
62
    title = None
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc