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

Commit613a5b3

Browse files
committed
tests: Windows fixes for "show" module
1 parent642eb1a commit613a5b3

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

‎tests/show_test.py‎renamed to ‎tests/show.py‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ def test_corrupt_2(self):
8888
# we should die here because exception is what we expect to happen
8989
self.assertEqual(
9090
1,0,
91-
"Expecting Error because backup corrupted.\n"
91+
"Expecting Error because backup corrupted."
9292
" Output: {0}\n CMD: {1}".format(
9393
repr(self.output),self.cmd
9494
)
9595
)
9696
exceptProbackupExceptionase:
9797
self.assertIn(
98-
'data files are corrupted\n',
98+
'data files are corrupted',
9999
e.message,
100100
'\n Unexpected Error Message: {0}\n'
101101
' CMD: {1}'.format(repr(e.message),self.cmd)
@@ -127,9 +127,15 @@ def test_no_control_file(self):
127127
backup_id,"backup.control")
128128
os.remove(file)
129129

130+
output=self.show_pb(backup_dir,'node',as_text=True,as_json=False)
131+
132+
self.assertIn(
133+
'Control file',
134+
output)
135+
130136
self.assertIn(
131-
'Control file "{0}"doesn\'t exist'.format(file),
132-
self.show_pb(backup_dir,'node',as_text=True,as_json=False))
137+
'doesn\'t exist',
138+
output)
133139

134140
# Clean after yourself
135141
self.del_test_dir(module_name,fname)
@@ -157,9 +163,15 @@ def test_empty_control_file(self):
157163
fd=open(file,'w')
158164
fd.close()
159165

166+
output=self.show_pb(backup_dir,'node',as_text=True,as_json=False)
167+
168+
self.assertIn(
169+
'Control file',
170+
output)
171+
160172
self.assertIn(
161-
'Control file "{0}"is empty'.format(file),
162-
self.show_pb(backup_dir,'node',as_text=True,as_json=False))
173+
'is empty',
174+
output)
163175

164176
# Clean after yourself
165177
self.del_test_dir(module_name,fname)
@@ -190,7 +202,7 @@ def test_corrupt_control_file(self):
190202
fd.close()
191203

192204
self.assertIn(
193-
'WARNING: Invalid option "statuss" in file'.format(file),
205+
'WARNING: Invalid option "statuss" in file',
194206
self.show_pb(backup_dir,'node',as_json=False,as_text=True))
195207

196208
# Clean after yourself

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp