Skip to content

Commit

Permalink
py.test: test #25, urlencoded filename
Browse files Browse the repository at this point in the history
  • Loading branch information
havardgulldahl committed Sep 3, 2015
1 parent 6ae92cf commit d44384c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_JFS.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,18 @@ def test_getObject(self):
assert isinstance(jfs.getObject('/Jotta/Archive/test'), JFS.JFSFolder)
#TODO: test with a python-requests object

@pytest.mark.xfail
def test_urlencoded_filename(self):
#TODO: make sure filenames that contain percent-encoded characters are
# correctly parsed
raise NotImplementedError
# https://github.com/havardgulldahl/jottalib/issues/25
import tempfile, posixpath, urllib, requests
f = '%2FVolumes%2FMedia%2Ftest.mov'
p = posixpath.join('/Jotta/Archive', f)
_f = tempfile.NamedTemporaryFile(prefix=f)
_f.write('123test')
jfs_f = jfs.up(p, _f)
assert jfs.session.get('%s%s' % (JFS.JFS_ROOT, jfs.username) + '/Jotta/Archive/%252FVolumes%252FMedia%252Ftest.mov').ok # check that strange file name is preserved
jfs_f.delete()

class TestJFSFileDirList:
'Tests for JFSFileDirList'
Expand Down

0 comments on commit d44384c

Please sign in to comment.