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

Commita4b37ca

Browse files
committed
more tests
1 parent0756cab commita4b37ca

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

‎tests/test_simple.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,9 @@ def test_unix_sockets(self):
598598
node.execute('postgres','select 1')
599599
node.safe_psql('postgres','select 1')
600600

601-
r=node.replicate('r').start()
602-
r.execute('postgres','select 1')
603-
r.safe_psql('postgres','select 1')
601+
withnode.replicate('r').start()asr:
602+
r.execute('postgres','select 1')
603+
r.safe_psql('postgres','select 1')
604604

605605
deftest_auto_name(self):
606606
withget_new_node().init(allow_streaming=True).start()asm:
@@ -617,6 +617,29 @@ def test_auto_name(self):
617617
self.assertTrue('testgres'inm.name)
618618
self.assertTrue('testgres'inr.name)
619619

620+
deftest_file_tail(self):
621+
fromtestgres.utilsimportfile_tail
622+
623+
s1="the quick brown fox jumped over that lazy dog\n"
624+
s2="abc\n"
625+
s3="def\n"
626+
627+
withtempfile.NamedTemporaryFile(mode='r+',delete=True)asf:
628+
foriinrange(1,5000):
629+
f.write(s1)
630+
f.write(s2)
631+
f.write(s3)
632+
633+
f.seek(0)
634+
lines=file_tail(f,3)
635+
self.assertEqual(lines[0],s1)
636+
self.assertEqual(lines[1],s2)
637+
self.assertEqual(lines[2],s3)
638+
639+
f.seek(0)
640+
lines=file_tail(f,1)
641+
self.assertEqual(lines[0],s3)
642+
620643
deftest_isolation_levels(self):
621644
withget_new_node('node').init().start()asnode:
622645
withnode.connect()ascon:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp