Nilesh Patra pushed to branch master at Debian Med / python-cigar
Commits: 79c5a87b by Nilesh Patra at 2021-05-22T21:56:13+00:00 Add autopkgtests - - - - - baf5e273 by Nilesh Patra at 2021-05-22T21:56:35+00:00 Add doc for running autopkgtest - - - - - bae9a928 by Nilesh Patra at 2021-05-22T21:57:39+00:00 Update upstream/metadata - - - - - 89bbc7dc by Nilesh Patra at 2021-05-23T03:29:06+05:30 Interim changelog entry - - - - - 8 changed files: - + debian/README.test - debian/changelog - + debian/docs - + debian/examples - + debian/tests/control - + debian/tests/run-unit-tests - + debian/tests/test_cigar_simple.py - debian/upstream/metadata Changes: ===================================== debian/README.test ===================================== @@ -0,0 +1,11 @@ +Notes on how this package can be tested. +──────────────────────────────────────── + +This package can be tested by running the provided test: + + sh run-unit-test + +in order to confirm its integrity. + +Notes on the files used for testing +──────────────────────────────────────── ===================================== debian/changelog ===================================== @@ -1,3 +1,12 @@ +python-cigar (0.1.3-2) UNRELEASED; urgency=medium + + * Team Upload. + * Add autopkgtests + * Add doc for running autopkgtest + * Add upstream/metadata + + -- Nilesh Patra <[email protected]> Sat, 22 May 2021 21:57:15 +0000 + python-cigar (0.1.3-1) unstable; urgency=low * Initial release (Closes: #988989) ===================================== debian/docs ===================================== @@ -0,0 +1,2 @@ +debian/tests/run-unit-tests +debian/README* ===================================== debian/examples ===================================== @@ -0,0 +1 @@ +debian/tests/test_cigar_simple.py ===================================== debian/tests/control ===================================== @@ -0,0 +1,3 @@ +Tests: run-unit-tests +Depends: @, python3-pytest +Restrictions: allow-stderr ===================================== debian/tests/run-unit-tests ===================================== @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +pkg=cigar + +if [ "${AUTOPKGTEST_TMP}" = "" ] ; then + AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX) + trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM +fi + +cd "${AUTOPKGTEST_TMP}" +cp -a /usr/share/doc/python3-${pkg}/examples/* . + +pytest-3 ===================================== debian/tests/test_cigar_simple.py ===================================== @@ -0,0 +1,28 @@ +from cigar import Cigar + +def test_basic(): + #Test 100M + c = Cigar('100M') + assert len(c) == 100 + assert list(c.items()) == [(100, 'M')] + + # Test '20H20M20S' + c = Cigar('20H20M20S') + assert len(c) == 40 + assert str(c) == '20H20M20S' + assert list(c.items()) == [(20, 'H'), (20, 'M'), (20, 'S')] + assert c.mask_left(29).cigar, c.cigar == ('20H9S11M20S', '20H20M20S') + + # Test '10M20S10M' + c = Cigar('10M20S10M') + assert c.mask_left(10).cigar == '30S10M' + assert c.mask_left(9).cigar == '9S1M20S10M' + + #Custom Tests + assert [Cigar('10S').mask_left(10).cigar, Cigar('10H').mask_left(10).cigar, Cigar('10H').mask_left(11).cigar, Cigar('10H').mask_left(9).cigar] == ['10S', '10H', '10H', '10H'] + assert Cigar('1M10H').mask_left(9).cigar, Cigar('5M10H').mask_left(9).cigar == ('1S10H', '5S10H') + c = Cigar('1S1H1S5H1S5M10H') + assert c.mask_left(9).cigar == c.cigar + c = Cigar('1S1H1S5H1S5M10H') + assert c.mask_right(9).cigar == c.cigar + assert c.mask_right(11).cigar == '1S1H1S5H1S4M1S10H' ===================================== debian/upstream/metadata ===================================== @@ -1,3 +1,10 @@ +--- +Archive: GitHub +Bug-Database: https://github.com/brentp/cigar/issues +Bug-Submit: https://github.com/brentp/cigar/issues/new +Changelog: https://github.com/brentp/cigar/tags +Repository: https://github.com/brentp/cigar.git +Repository-Browse: https://github.com/brentp/cigar Registry: - Name: conda:bioconda Entry: cigar View it on GitLab: https://salsa.debian.org/med-team/python-cigar/-/compare/aad1bf0dc385073a5aa87b4a65bd0f34fb303d84...89bbc7dc967b242dca04f81d30f9f216e3e4549f -- View it on GitLab: https://salsa.debian.org/med-team/python-cigar/-/compare/aad1bf0dc385073a5aa87b4a65bd0f34fb303d84...89bbc7dc967b242dca04f81d30f9f216e3e4549f You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
