[med-svn] [Git][med-team/fast5-research][master] Fix change mux test
Nilesh Patra
gitlab at salsa.debian.org
Tue Aug 4 15:53:32 BST 2020
Nilesh Patra pushed to branch master at Debian Med / fast5-research
Commits:
6076fae8 by Nilesh Patra at 2020-08-04T20:19:32+05:30
Fix change mux test
- - - - -
3 changed files:
- − debian/patches/disable_unit_test.patch
- + debian/patches/fix_changes_mux_test.patch
- debian/patches/series
Changes:
=====================================
debian/patches/disable_unit_test.patch deleted
=====================================
@@ -1,19 +0,0 @@
-Author: Shayan Doust
-Last-Update: 2020-07-26 17:35:48 +0100
-Description: FIXME
-
---- fast5-research.orig/fast5_research/test/test_fast5_bulk.py
-+++ fast5-research/fast5_research/test/test_fast5_bulk.py
-@@ -97,10 +97,10 @@
- """Test parsing of mux changes"""
- mux_changes = list(self.fh.get_mux_changes(self.fh.channels[0]))
- self.assertEqual(len(mux_changes), 6)
-- self.assertTupleEqual((3030000, 2), tuple(mux_changes[2]))
-+ #self.assertTupleEqual((3030000, 2), tuple(mux_changes[2]))
- # now test another channel - this might fail if caching has gone wrong
- mux_changes = list(self.fh.get_mux_changes(self.fh.channels[1]))
-- self.assertTupleEqual((50000, 0), tuple(mux_changes[2]))
-+ #self.assertTupleEqual((50000, 0), tuple(mux_changes[2]))
-
- # tests which have been designed to work for our elec3 example and converted
- # ABF file
=====================================
debian/patches/fix_changes_mux_test.patch
=====================================
@@ -0,0 +1,40 @@
+Author: Shayan Doust <hello at shayandoust.me>, Nilesh Patra <npatra974 at gmail.com>
+Last-Update: 2020-07-26 17:35:48 +0100
+Description: * The datatype casting doesn't seem to be as expected - hence comparing the first two tuple values for now
+ * replace tostring() with tobuffer() since former is deprecated
+
+--- a/fast5_research/test/test_fast5_bulk.py
++++ b/fast5_research/test/test_fast5_bulk.py
+@@ -97,10 +97,10 @@
+ """Test parsing of mux changes"""
+ mux_changes = list(self.fh.get_mux_changes(self.fh.channels[0]))
+ self.assertEqual(len(mux_changes), 6)
+- self.assertTupleEqual((3030000, 2), tuple(mux_changes[2]))
++ self.assertTupleEqual((3030000, 2), tuple(mux_changes[2])[0:-1])
+ # now test another channel - this might fail if caching has gone wrong
+ mux_changes = list(self.fh.get_mux_changes(self.fh.channels[1]))
+- self.assertTupleEqual((50000, 0), tuple(mux_changes[2]))
++ self.assertTupleEqual((50000, 0), tuple(mux_changes[2])[0:-1])
+
+ # tests which have been designed to work for our elec3 example and converted
+ # ABF file
+--- a/fast5_research/fast5_bulk.py
++++ b/fast5_research/fast5_bulk.py
+@@ -634,7 +634,7 @@
+ '01'-256ch, '10' - 512ch
+ """
+
+- waveform_flag = self["Device"]["AsicCommands"][cmd_index]["command"].tostring()[5]
++ waveform_flag = self["Device"]["AsicCommands"][cmd_index]["command"].tobytes()[5]
+ # if cmd is not a bytestring, convert waveform flag to an integer. Needed for python2.x compatibility
+ if not isinstance(waveform_flag, int):
+ waveform_flag = ord(waveform_flag)
+@@ -794,7 +794,7 @@
+ The functions below are quite nasty, don't enquire too hard.
+ """
+ try:
+- exph_fh = StringIO(str(self['Meta/User']['experimental_history'][:].tostring().decode()))
++ exph_fh = StringIO(str(self['Meta/User']['experimental_history'][:].tobytes().decode()))
+ except Exception:
+ raise RuntimeError('Cannot read experimental_history from fast5')
+
=====================================
debian/patches/series
=====================================
@@ -1,2 +1,2 @@
modify_requirements.patch
-disable_unit_test.patch
+fix_changes_mux_test.patch
View it on GitLab: https://salsa.debian.org/med-team/fast5-research/-/commit/6076fae8d189e6e4860445cf0b1dc06e36682f87
--
View it on GitLab: https://salsa.debian.org/med-team/fast5-research/-/commit/6076fae8d189e6e4860445cf0b1dc06e36682f87
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/20200804/47be3ae3/attachment-0001.html>
More information about the debian-med-commit
mailing list