File: test_builds.py

package info (click to toggle)
python-barcode 0.15.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: python: 1,661; makefile: 23; sh: 9
file content (15 lines) | stat: -rwxr-xr-x 463 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from barcode import get_barcode


def test_ean8_builds():
    ref = "1010100011000110100100110101111010101000100100010011100101001000101"
    ean = get_barcode("ean8", "40267708")
    bc = ean.build()
    assert ref == bc[0]


def test_ean8_builds_with_longer_bars():
    ref = "G0G01000110001101001001101011110G0G01000100100010011100101001000G0G"
    ean = get_barcode("ean8", "40267708", options={"guardbar": True})
    bc = ean.build()
    assert ref == bc[0]