Skip to content

Commit ef132ef

Browse files
committed
test: add list
1 parent e004da3 commit ef132ef

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ Methods
5858
... 'end': '/end/path/',
5959
... 'prefix': 'object-prefix',
6060
... 'slash': 'both',
61-
... 'encoding': 'utf8'
61+
... 'encoding': 'utf-8'
6262
... }
6363
>>> ns.dir(NETSTORAGE_PATH, dir_option)
6464
>>> ns.download(NETSTORAGE_SOURCE, LOCAL_DESTINATION)
6565
>>> ns.du(NETSTORAGE_PATH)
6666
>>> list_option = {
6767
... 'max_entries': INTEGER,
6868
... 'end': '/end/path/',
69-
... 'encoding': 'utf8'
69+
... 'encoding': 'utf-8'
7070
... }
7171
>>> ns.list(NETSTORAGE_PATH, list_option)
7272
>>> ns.mkdir(NETSTORAGE_PATH + DIRECTORY_NAME)

test/test_netstorage.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ def test_netstorage(self):
105105
self.assertEqual(stream_upload_text, res.text, "stream download fail")
106106
print("[TEST] stream_download {0} done".format(self.temp_ns_stream_file))
107107

108+
# list
109+
ok, _ = self.ns.list("/" + self.cpcode_path, {
110+
'max_entries': 1,
111+
'end': self.temp_ns_dir,
112+
'encoding': 'utf-8'
113+
}
114+
)
115+
self.assertEqual(True, ok, "dir fail.")
116+
print("[TEST] dir {0} done".format("/" + self.cpcode_path))
117+
108118
# du
109119
ok, res = self.ns.du(self.temp_ns_dir)
110120
self.assertEqual(True, ok)

0 commit comments

Comments
 (0)