Skip to content

Commit c030e69

Browse files
committed
test: save_external check name & url
1 parent 204d29e commit c030e69

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/test_file.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@ def test_query(): # type: () -> None
111111

112112
@with_setup(setup_func)
113113
def test_save_external(): # type: () -> None
114-
f = File.create_with_url(
115-
"lenna.jpg", "http://i1.wp.com/leancloud.cn/images/static/default-avatar.png"
116-
)
114+
file_name = "lenna.jpg"
115+
file_url = "http://i1.wp.com/leancloud.cn/images/static/default-avatar.png"
116+
f = File.create_with_url(file_name, file_url)
117117
f.save()
118118
assert f.id
119+
file_on_cloud = File.create_without_data(f.id)
120+
file_on_cloud.fetch()
121+
assert file_on_cloud.name == file_name
122+
assert file_on_cloud.url == file_url
119123

120124

121125
@raises(ValueError)

0 commit comments

Comments
 (0)