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

iplweb / bpp / c5db2772-42ef-40cf-977b-8238df9ca907

21 Aug 2025 09:47AM UTC coverage: 46.22% (-0.06%) from 46.283%
c5db2772-42ef-40cf-977b-8238df9ca907

push

circleci

mpasternak
Merge branch 'release/v202508.1195'

3 of 3 new or added lines in 2 files covered. (100.0%)

2836 existing lines in 173 files now uncovered.

17625 of 38133 relevant lines covered (46.22%)

1.18 hits per line

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

53.13
src/bpp/tests/test_util.py
UNCOV
1
import pytest
1✔
2

UNCOV
3
from bpp.util import (
1✔
4
    fulltext_tokenize,
5
    knapsack,
6
    strip_html,
7
    strip_nonalphanumeric,
8
    wytnij_isbn_z_uwag,
9
)
10

11

UNCOV
12
@pytest.mark.parametrize(
1✔
13
    "input,output,rest",
14
    [
15
        ("ISBN 978-83-7374-091-4, ten tego", "978-83-7374-091-4", "ten tego"),
16
        ("ISBN 83-200-1817-X", "83-200-1817-X", ""),
17
        ("tu nie ma ISBNu", None, None),
18
        ("ISBN-10 978-83-7374-091-4; ISBN-13 958498498894, ten tego", None, None),
19
    ],
20
)
UNCOV
21
def test_wytnij_isbn_z_uwag(input, output, rest):
1✔
22
    res = wytnij_isbn_z_uwag(input)
×
23
    if output is None:
×
24
        assert res is None
×
25
        return
×
26

27
    isbn, reszta = res
×
28
    assert isbn == output
×
29
    assert reszta == rest
×
30

31

UNCOV
32
def test_knapsack_empty():
1✔
33
    assert knapsack(10, [], [], []) == (0, [])
×
34

35

UNCOV
36
@pytest.mark.timeout(5)
1✔
UNCOV
37
def test_knapsack_very_long():
1✔
38
    # Test na optymalizacje sytuacji gdy chcemy dostac znacznie wiecej punktow niz wychdozi z danej listy,
39
    knapsack(99900, [1] * 99800, [1] * 99800, [1] * 99800)
×
40

41

UNCOV
42
def test_knapsack_zwracaj_liste():
1✔
43
    assert knapsack(
×
44
        10,
45
        [1, 2, 3, 4, 5],
46
        [1, 2, 3, 4, 5],
47
        [
48
            "a",
49
            "b",
50
            "c",
51
            "d",
52
            "e",
53
        ],
54
        True,
55
    ) == (10, ["d", "c", "b", "a"])
56

57

UNCOV
58
def test_knapsack_nie_zwracaj_listy():
1✔
59
    assert knapsack(
×
60
        10,
61
        [1, 2, 3, 4, 5],
62
        [1, 2, 3, 4, 5],
63
        [
64
            "a",
65
            "b",
66
            "c",
67
            "d",
68
            "e",
69
        ],
70
        zwracaj_liste_przedmiotow=False,
71
    ) == (10, [])
72

73

UNCOV
74
@pytest.mark.django_db
1✔
UNCOV
75
def test_ModelZOpisemBibliograficznym(wydawnictwo_ciagle):
1✔
76
    assert wydawnictwo_ciagle.opis_bibliograficzny() != ""
×
77

78

UNCOV
79
@pytest.mark.parametrize(
1✔
80
    "i,o", [("<b>test", "test"), ("<b>test</b>", "test"), ("", ""), (None, None)]
81
)
UNCOV
82
def test_strip_html(i, o):
1✔
83
    assert strip_html(i) == o
×
84

85

UNCOV
86
@pytest.mark.parametrize(
1✔
87
    "i, o",
88
    [("identyfikacja markerów molekularnych", "identyfikacja markerów molekularnych")],
89
)
UNCOV
90
def test_strip_nonalphanumeric(i, o):
1✔
91
    assert strip_nonalphanumeric(i) == o
×
92

93

UNCOV
94
@pytest.mark.parametrize(
1✔
95
    "i, o",
96
    [
97
        (
98
            "identyfikacja markerów molekularnych",
99
            ["identyfikacja", "markerów", "molekularnych"],
100
        )
101
    ],
102
)
UNCOV
103
def test_fulltext_tokenize(i, o):
1✔
104
    assert fulltext_tokenize(i) == o
×
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