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

iplweb / bpp / 79f9159b-fc2b-4fb0-a03d-b2c486c11307

18 Aug 2025 07:01PM UTC coverage: 39.761% (-5.8%) from 45.554%
79f9159b-fc2b-4fb0-a03d-b2c486c11307

push

circleci

mpasternak
Merge branch 'release/v202508.1190'

15 of 56 new or added lines in 7 files covered. (26.79%)

1686 existing lines in 105 files now uncovered.

15161 of 38130 relevant lines covered (39.76%)

0.4 hits per line

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

0.0
src/bpp/tests/test_util.py
UNCOV
1
import pytest
×
2

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

11

UNCOV
12
@pytest.mark.parametrize(
×
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):
×
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():
×
33
    assert knapsack(10, [], [], []) == (0, [])
×
34

35

UNCOV
36
@pytest.mark.timeout(5)
×
UNCOV
37
def test_knapsack_very_long():
×
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():
×
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():
×
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
×
UNCOV
75
def test_ModelZOpisemBibliograficznym(wydawnictwo_ciagle):
×
76
    assert wydawnictwo_ciagle.opis_bibliograficzny() != ""
×
77

78

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

85

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

93

UNCOV
94
@pytest.mark.parametrize(
×
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):
×
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