Skip to content

Commit b0fbd9b

Browse files
committed
Fix: disabled tests for files module were still causing problems
1 parent 87e441e commit b0fbd9b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/bd2k/util/test/test_files.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
from mock import MagicMock, call
44

5-
from bd2k.util.files import gread, gwrite
6-
75

86
class TestFiles( TestCase ):
97
if False:
8+
from bd2k.util.files import gread, gwrite
109
# See comment in module under test
1110
def test_gread( self ):
1211
for n in range( 0, 4 ):
@@ -16,7 +15,7 @@ def test_gread( self ):
1615
f.read.side_effect = [ '1', '2', '' ]
1716
# Read n bytes greedily
1817
# noinspection PyTypeChecker
19-
self.assertEqual( gread( f, n ), "12"[ :n ] )
18+
self.assertEqual( self.gread( f, n ), "12"[ :n ] )
2019
# First call to read() should request n bytes and then one less on each subsequent call.
2120
self.assertEqual( f.mock_calls, [ call.read( i ) for i in range( n, 0, -1 ) ] )
2221

@@ -27,7 +26,7 @@ def test_gwrite( self ):
2726
f.write.side_effect = [ 1 ] * n
2827
s = "12"[ :n ]
2928
# noinspection PyTypeChecker
30-
gwrite( f, s )
29+
self.gwrite( f, s )
3130
# The first call to write() should be passed the entire string, minus one byte off
3231
# the front for each subsequent call.
3332
self.assertEqual( f.mock_calls, [ call.write( s[ i: ] ) for i in range( 0, n ) ] )

0 commit comments

Comments
 (0)