Skip to content

Commit 7d4ba9d

Browse files
committed
tests/io/resource_stream: Add test for uio.resource_stream().
1 parent d7da2db commit 7d4ba9d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/io/resource_stream.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import uio
2+
import sys
3+
4+
try:
5+
uio.resource_stream
6+
except AttributeError:
7+
print('SKIP')
8+
sys.exit()
9+
10+
try:
11+
buf = uio.resource_stream("data", "file2")
12+
except NotImplementedError:
13+
pass
14+
15+
# resource_stream(None, ...) look ups from current dir, hence sys.path[0] hack
16+
buf = uio.resource_stream(None, sys.path[0] + "/data/file2")
17+
print(buf.read())

tests/io/resource_stream.py.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1234

0 commit comments

Comments
 (0)