[med-svn] [Git][med-team/resfinder][master] 4 commits: Install Python modules

Andreas Tille gitlab at salsa.debian.org
Fri Dec 4 22:33:50 GMT 2020



Andreas Tille pushed to branch master at Debian Med / resfinder


Commits:
352027b4 by Andreas Tille at 2020-12-04T22:44:23+01:00
Install Python modules

- - - - -
181976df by Andreas Tille at 2020-12-04T23:10:32+01:00
Set path in testscript, do not install trash

- - - - -
8d0a15dd by Andreas Tille at 2020-12-04T23:12:12+01:00
Fix syntax

- - - - -
5dfddc29 by Andreas Tille at 2020-12-04T23:33:18+01:00
Work arround not-executable test script

- - - - -


7 changed files:

- debian/changelog
- + debian/patches/fix_path_in_testscript.patch
- + debian/patches/fix_syntax.patch
- + debian/patches/series
- debian/resfinder.install
- debian/rules
- debian/tests/run-unit-test


Changes:

=====================================
debian/changelog
=====================================
@@ -3,8 +3,6 @@ resfinder (4.0.1-1) UNRELEASED; urgency=medium
   * New upstream version
   * debhelper-compat 13 (routine-update)
   * resfinder.py is now run_resfinder.py
-  TODO: No idea how to properly test the package, asked upstream in
-        https://bitbucket.org/genomicepidemiology/resfinder/issues/31/how-to-properly-test-resfinder
 
  -- Andreas Tille <tille at debian.org>  Sat, 03 Oct 2020 12:00:25 +0200
 


=====================================
debian/patches/fix_path_in_testscript.patch
=====================================
@@ -0,0 +1,51 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Sat, 03 Oct 2020 12:00:25 +0200
+Description: run_resfinder.py is in PATH
+
+--- a/tests/functional_tests.py
++++ b/tests/functional_tests.py
+@@ -70,7 +70,7 @@ class ResFinderRunTest(unittest.TestCase
+         # She therefore runs resfinder cmd line.
+ 
+         # First Maria checks out the documentation.
+-        procs = run("python3 ../run_resfinder.py -h", shell=True, stdout=PIPE,
++        procs = run("run_resfinder.py -h", shell=True, stdout=PIPE,
+                     check=True)
+         output = procs.stdout.decode()
+         self.assertIn("--help", output)
+@@ -81,7 +81,7 @@ class ResFinderRunTest(unittest.TestCase
+         test1_dir = run_test_dir + "/" + test_names[0]
+         os.makedirs(test1_dir)
+         # Then she runs run_resfinder with her first isolate.
+-        cmd_acquired = ("python3  " + self.dir_res + "/run_resfinder.py"
++        cmd_acquired = ("run_resfinder.py"
+                         + " -ifa " + test_data[test_names[0]]
+                         + " -o " + test1_dir
+                         + " -s 'Escherichia coli'"
+@@ -139,7 +139,7 @@ class ResFinderRunTest(unittest.TestCase
+         os.makedirs(test2_dir, exist_ok=False)
+ 
+         # Then she runs run_resfinder with her first isolate.
+-        cmd_acquired = ("python3 " + self.dir_res + "/run_resfinder.py"
++        cmd_acquired = ("run_resfinder.py"
+                         + " -ifq " + test_data[test_names[1]]
+                         + " -o " + test2_dir
+                         + " -s 'Escherichia coli'"
+@@ -196,7 +196,7 @@ class ResFinderRunTest(unittest.TestCase
+         os.makedirs(test3_dir)
+ 
+         # Then she runs run_resfinder with her first isolate.
+-        cmd_point = ("python3 " + self.dir_res + "/run_resfinder.py"
++        cmd_point = ("run_resfinder.py"
+                      + " -ifa " + test_data[test_names[2]]
+                      + " -o " + test3_dir
+                      + " -s 'Escherichia coli'"
+@@ -240,7 +240,7 @@ class ResFinderRunTest(unittest.TestCase
+         os.makedirs(test4_dir, exist_ok=False)
+ 
+         # Then she runs run_resfinder with her first isolate.
+-        cmd_acquired = ("python3 " + self.dir_res + "/run_resfinder.py"
++        cmd_acquired = ("run_resfinder.py"
+                         + " -ifq " + test_data[test_names[3]]
+                         + " -o " + test4_dir
+                         + " -s 'Escherichia coli'"


=====================================
debian/patches/fix_syntax.patch
=====================================
@@ -0,0 +1,15 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Sat, 03 Oct 2020 12:00:25 +0200
+Description: Fix syntax
+
+--- a/cge/resfinder.py
++++ b/cge/resfinder.py
+@@ -424,7 +424,7 @@ class ResFinder(CGEFinder):
+         """
+         """
+         # Check if databases and config file are correct/correponds
+-        if databases is '':
++        if databases == '':
+                 sys.exit("Input Error: No database was specified!\n")
+         elif databases is None:
+             # Choose all available databases from the config file


=====================================
debian/patches/series
=====================================
@@ -0,0 +1,2 @@
+fix_path_in_testscript.patch
+fix_syntax.patch


=====================================
debian/resfinder.install
=====================================
@@ -1 +1,3 @@
 *.py	usr/share/resfinder
+cge	usr/share/resfinder
+scripts	usr/share/resfinder


=====================================
debian/rules
=====================================
@@ -3,5 +3,9 @@
 %:
 	dh $@ --with python3
 
+override_dh_install:
+	dh_install
+	find debian -name trash -type d | xargs rm -rf
+
 override_dh_installman:
 	dh_installman --language=C


=====================================
debian/tests/run-unit-test
=====================================
@@ -15,4 +15,4 @@ cd "${AUTOPKGTEST_TMP}"
 
 gunzip -r *
 
-python3 unit_tests.py
+python3 functional_tests.py



View it on GitLab: https://salsa.debian.org/med-team/resfinder/-/compare/19f0c5e316810b942e7cd24f3ad95d09550b95a3...5dfddc299f3f20dbf1650934eb4baa79e5303652

-- 
View it on GitLab: https://salsa.debian.org/med-team/resfinder/-/compare/19f0c5e316810b942e7cd24f3ad95d09550b95a3...5dfddc299f3f20dbf1650934eb4baa79e5303652
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/20201204/531503db/attachment-0001.html>


More information about the debian-med-commit mailing list