Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc2c2d4c

Browse files
TestOsOpsCommon is updated
New tests:- test_read_binary__spec__negative_offset- test_get_file_size
1 parent75b0804 commitc2c2d4c

File tree

3 files changed

+26
-46
lines changed

3 files changed

+26
-46
lines changed

‎tests/test_local.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,6 @@ def test_read_binary__spec__unk_file(self):
114114
match=re.escape("[Errno 2] No such file or directory: '/dummy'")):
115115
self.operations.read_binary("/dummy",0)
116116

117-
deftest_read_binary__spec__negative_offset(self):
118-
"""
119-
Test LocalOperations::read_binary with negative offset.
120-
"""
121-
122-
withpytest.raises(
123-
ValueError,
124-
match=re.escape("Negative 'offset' is not supported.")):
125-
self.operations.read_binary(__file__,-1)
126-
127-
deftest_get_file_size(self):
128-
"""
129-
Test LocalOperations::get_file_size.
130-
"""
131-
filename=__file__# current file
132-
133-
sz0=os.path.getsize(filename)
134-
asserttype(sz0)==int# noqa: E721
135-
136-
sz1=self.operations.get_file_size(filename)
137-
asserttype(sz1)==int# noqa: E721
138-
assertsz1==sz0
139-
140117
deftest_get_file_size__unk_file(self):
141118
"""
142119
Test LocalOperations::get_file_size.

‎tests/test_os_ops_common.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,32 @@ def test_read_binary__spec(self, os_ops: OsOperations):
120120
asserttype(response5)==bytes# noqa: E721
121121
assertlen(response5)==0
122122

123+
deftest_read_binary__spec__negative_offset(self,os_ops:OsOperations):
124+
"""
125+
Test RemoteOperations::read_binary with negative offset.
126+
"""
127+
assertisinstance(os_ops,OsOperations)
128+
129+
withpytest.raises(
130+
ValueError,
131+
match=re.escape("Negative 'offset' is not supported.")):
132+
os_ops.read_binary(__file__,-1)
133+
134+
deftest_get_file_size(self,os_ops:OsOperations):
135+
"""
136+
Test RemoteOperations::get_file_size.
137+
"""
138+
assertisinstance(os_ops,OsOperations)
139+
140+
filename=__file__# current file
141+
142+
sz0=os.path.getsize(filename)
143+
asserttype(sz0)==int# noqa: E721
144+
145+
sz1=os_ops.get_file_size(filename)
146+
asserttype(sz1)==int# noqa: E721
147+
assertsz1==sz0
148+
123149
deftest_isfile_true(self,os_ops:OsOperations):
124150
"""
125151
Test isfile for an existing file.

‎tests/test_remote.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -320,29 +320,6 @@ def test_read_binary__spec__unk_file(self):
320320
assert"No such file or directory"instr(x.value)
321321
assert"/dummy"instr(x.value)
322322

323-
deftest_read_binary__spec__negative_offset(self):
324-
"""
325-
Test RemoteOperations::read_binary with negative offset.
326-
"""
327-
328-
withpytest.raises(
329-
ValueError,
330-
match=re.escape("Negative 'offset' is not supported.")):
331-
self.operations.read_binary(__file__,-1)
332-
333-
deftest_get_file_size(self):
334-
"""
335-
Test RemoteOperations::get_file_size.
336-
"""
337-
filename=__file__# current file
338-
339-
sz0=os.path.getsize(filename)
340-
asserttype(sz0)==int# noqa: E721
341-
342-
sz1=self.operations.get_file_size(filename)
343-
asserttype(sz1)==int# noqa: E721
344-
assertsz1==sz0
345-
346323
deftest_get_file_size__unk_file(self):
347324
"""
348325
Test RemoteOperations::get_file_size.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp