[med-svn] [Git][med-team/dnapi][master] 3 commits: Add autopkgtests
Nilesh Patra
gitlab at salsa.debian.org
Sat Oct 24 21:20:10 BST 2020
Nilesh Patra pushed to branch master at Debian Med / dnapi
Commits:
5ef6ed0b by Nilesh Patra at 2020-10-25T01:46:10+05:30
Add autopkgtests
- - - - -
81a9cf87 by Nilesh Patra at 2020-10-25T01:46:59+05:30
compat: 13
- - - - -
21ed0524 by Nilesh Patra at 2020-10-25T01:47:44+05:30
Update changelog
- - - - -
6 changed files:
- debian/changelog
- debian/control
- debian/dnapi.examples
- + debian/tests/control
- + debian/tests/run-unit-test
- + debian/tests/simple_test.py
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+dnapi (1.1-3) unstable; urgency=medium
+
+ * Team Upload.
+ * Add autopkgtests
+ * compat: 13
+
+ -- Nilesh Patra <npatra974 at gmail.com> Sun, 25 Oct 2020 01:47:05 +0530
+
dnapi (1.1-2) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -4,7 +4,7 @@ Uploaders: Steffen Moeller <moeller at debian.org>
Section: science
Testsuite: autopkgtest-pkg-python
Priority: optional
-Build-Depends: debhelper-compat (= 12),
+Build-Depends: debhelper-compat (= 13),
dh-python,
python3-setuptools,
python3-all
=====================================
debian/dnapi.examples
=====================================
@@ -1 +1,3 @@
examples/*
+debian/tests/simple_test.py
+debian/tests/run-unit-test
=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, python3, python3-pytest
+Restrictions: allow-stderr
=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -e
+
+pkg="dnapi"
+
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+ AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+ trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP
+
+cd $AUTOPKGTEST_TMP
+gunzip -r *
+
+function compare_ref()
+{
+ # $1: Test number
+ # $2, $3: values to be compared
+ echo "I: Test $1"
+ if [ "$2" = "$3" ]
+ then
+ echo "PASSED!"
+ else
+ echo "$2 is not equal to $3"
+ exit 1
+ fi
+}
+
+compare_ref 1 $(dnapi.py good.fq) TGGAATTCTCGG
+compare_ref 2 $(dnapi.py -k 8:11:1 -r 1.1:1.4:0.1 good.fq) TGGAATTCTCGG
+compare_ref 3 $(dnapi.py --show-all poor.fq | md5sum | awk '{print $1}') 1e4d27f27c0e2bb3ea80871105748d45
+compare_ref 4 $(dnapi.py -k 9 -r 1.4 good.fq) TGGAATTCTCGGGTGCCAAGGAACTCC
+
+echo "Testing python counterpart ..."
+python3 -m pytest -v simple_test.py
+echo "PASSED!"
+
=====================================
debian/tests/simple_test.py
=====================================
@@ -0,0 +1,16 @@
+from dnapilib.apred import adapter_prediction
+from dnapilib.apred import iterative_adapter_prediction
+
+def test_functional():
+ iterative_result = iterative_adapter_prediction("good.fq", [1.2, 1.3, 1.4], [9, 11], 50000)
+ single_result = adapter_prediction("good.fq", 1.4, 9, 50000)
+
+
+ assert(iterative_result[0][0] == 'TGGAATTCTCGG')
+ assert(single_result[0][0] == 'TGGAATTCTCGGGTGCCAAGGAACTCC')
+
+ iterative_result = iterative_adapter_prediction("processed.fq", [1.2, 1.3, 1.4], [9, 11], 50000)
+ single_result = adapter_prediction("processed.fq", 1.4, 9, 50000)
+
+ assert([x[0] for x in iterative_result] == ['TCTGCCCAGTGCTCTG', 'TAATACTGCCTG', 'TGGCAGTGTCTT'])
+ assert([x[0] for x in single_result] == ['TAATACTGCCTGGTAATGATG', 'TGGCAGTGTCTTAGCTGGTTG', 'CTGCCCAGTGCTCTGAA'])
View it on GitLab: https://salsa.debian.org/med-team/dnapi/-/compare/7149c96dd5cd0ff5c69e45dd7707f9dd7ae5e226...21ed052482eabf2ffbbc8a9ea09ebbf671cfabef
--
View it on GitLab: https://salsa.debian.org/med-team/dnapi/-/compare/7149c96dd5cd0ff5c69e45dd7707f9dd7ae5e226...21ed052482eabf2ffbbc8a9ea09ebbf671cfabef
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20201024/f5658719/attachment-0001.html>
More information about the debian-med-commit
mailing list