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

zopefoundation / ZopeUndo / 16399719109

28 Apr 2025 06:42AM UTC coverage: 100.0%. Remained the same
16399719109

push

github

web-flow
Update Python version support. (#9)

* Drop support for Python 3.7, 3.8.

* Add support for Python 3.12, 3.13.

18 of 18 branches covered (100.0%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

44 of 44 relevant lines covered (100.0%)

1.0 hits per line

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

100.0
/src/ZopeUndo/tests/test_prefix.py
1
##############################################################################
2
#
3
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE
12
#
13
##############################################################################
14

15
import unittest
1✔
16

17
from ZopeUndo.Prefix import Prefix
1✔
18

19

20
class PrefixTest(unittest.TestCase):
1✔
21

22
    def test(self):
1✔
23
        p1 = Prefix("/a/b")
1✔
24

25
        # test "==" (__eq__) operator
26
        for equal in ("/a/b", "/a/b/c", "/a/b/c/d"):
1✔
27
            self.assertEqual(p1, equal)
1✔
28
        for notEqual in ("", "/a/c", "/a/bbb", "///"):
1✔
29
            self.assertNotEqual(p1, notEqual)
1✔
30

31
        # test "!=" (__ne__) operator
32
        for equal in ("/a/b", "/a/b/c", "/a/b/c/d"):
1✔
33
            self.assertEqual(p1, equal)
1✔
34
        for notEqual in ("", "/a/c", "/a/bbb", "///"):
1✔
35
            self.assertNotEqual(p1, notEqual)
1✔
36

37
        p2 = Prefix("")
1✔
38
        for equal in ("", "/", "/def", "/a/b", "/a/b/c", "/a/b/c/d"):
1✔
39
            self.assertEqual(p2, equal)
1✔
40

41
    def test_username_info(self):
1✔
42
        # Zope Collector 1810; user paths have username appended
43
        p1 = Prefix('/a/b')
1✔
44
        for equal in ('/a/b spam', '/a/b/c spam', '/a/b/c/b spam'):
1✔
45
            self.assertEqual(p1, equal)
1✔
46
        for notEqual in (" spam", "/a/c spam", "/a/bbb spam", "/// spam"):
1✔
47
            self.assertNotEqual(p1, notEqual)
1✔
48

49
        p2 = Prefix("")
1✔
50
        for equal in (" eggs", "/ eggs", "/def eggs", "/a/b eggs",
1✔
51
                      "/a/b/c eggs", "/a/b/c/d eggs"):
52
            self.assertEqual(p2, equal)
1✔
53

54
    def test__repr__(self):
1✔
55
        p1 = Prefix('/a/b')
1✔
56
        self.assertEqual(repr(p1), "Prefix('/a/b')")
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