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

bagerard / mongoengine / 11077295734

27 Sep 2024 08:28PM UTC coverage: 94.456%. First build
11077295734

push

github

bagerard
Fix text index on multiple fields , order independent (#2612)

6 of 7 new or added lines in 2 files covered. (85.71%)

5316 of 5628 relevant lines covered (94.46%)

1.88 hits per line

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

95.0
/mongoengine/base/utils.py
1
import re
2✔
2

3

4
class LazyRegexCompiler:
2✔
5
    """Descriptor to allow lazy compilation of regex"""
6

7
    def __init__(self, pattern, flags=0):
2✔
8
        self._pattern = pattern
2✔
9
        self._flags = flags
2✔
10
        self._compiled_regex = None
2✔
11

12
    @property
2✔
13
    def compiled_regex(self):
2✔
14
        if self._compiled_regex is None:
2✔
15
            self._compiled_regex = re.compile(self._pattern, self._flags)
2✔
16
        return self._compiled_regex
2✔
17

18
    def __get__(self, instance, owner):
2✔
19
        return self.compiled_regex
2✔
20

21
    def __set__(self, instance, value):
2✔
22
        raise AttributeError("Can not set attribute LazyRegexCompiler")
2✔
23

24

25
class NonOrderedList(list):
2✔
26
    """Simple utility class to compare lists without considering order (useful in context of indexes)"""
27

28
    def __eq__(self, other):
2✔
29
        if isinstance(other, list):
2✔
30
            # Compare sorted versions of the lists
31
            return sorted(self) == sorted(other)
2✔
NEW
32
        return False
×
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

© 2026 Coveralls, Inc