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

Commita0ebde3

Browse files
committed
Return 0 when no pid, do the same for backend pid, and add packages to Dockerfile template
1 parent61b5d44 commita0ebde3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

‎Dockerfile.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ FROM postgres:${PG_VERSION}-alpine
22

33
ENV PYTHON=python${PYTHON_VERSION}
44
RUN if [ "${PYTHON_VERSION}" = "2" ] ; then \
5-
apk add --no-cache curl python2 py-virtualenv py-pip; \
5+
apk add --no-cache curl python2python2-dev gccpy-virtualenv py-pip; \
66
fi
77
RUN if [ "${PYTHON_VERSION}" = "3" ] ; then \
8-
apk add --no-cache curl python3 py-virtualenv; \
8+
apk add --no-cache curl python3python3-dev gccpy-virtualenv; \
99
fi
1010
ENV LANG=C.UTF-8
1111

‎testgres/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, node, dbname=None, username=None, password=None):
3434
username=usernameordefault_username()
3535

3636
self._node=node
37-
self._backend_pid=None
37+
self._backend_pid=0
3838

3939
self._connection=pglib.connect(
4040
database=dbname,
@@ -55,7 +55,7 @@ def connection(self):
5555

5656
@property
5757
defbackend_pid(self):
58-
ifself._backend_pidisNone:
58+
ifnotself._backend_pid:
5959
self._backend_pid=self.execute("select pg_backend_pid();")[0][0]
6060
returnself._backend_pid
6161

‎testgres/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def get_main_pid(self):
439439
returnint(f.readline())
440440

441441
# for clarity
442-
returnNone
442+
return0
443443

444444
defget_child_processes(self):
445445
''' Returns child processes for this node '''

‎tests/test_simple.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,27 +205,27 @@ def test_status(self):
205205

206206
# check statuses after each operation
207207
withget_new_node()asnode:
208-
self.assertIsNone(node.pid)
208+
self.assertEqual(node.pid,0)
209209
self.assertEqual(node.status(),NodeStatus.Uninitialized)
210210

211211
node.init()
212212

213-
self.assertIsNone(node.pid)
213+
self.assertEqual(node.pid,0)
214214
self.assertEqual(node.status(),NodeStatus.Stopped)
215215

216216
node.start()
217217

218-
self.assertIsNotNone(node.pid)
218+
self.assertNotEqual(node.pid,0)
219219
self.assertEqual(node.status(),NodeStatus.Running)
220220

221221
node.stop()
222222

223-
self.assertIsNone(node.pid)
223+
self.assertEqual(node.pid,0)
224224
self.assertEqual(node.status(),NodeStatus.Stopped)
225225

226226
node.cleanup()
227227

228-
self.assertIsNone(node.pid)
228+
self.assertEqual(node.pid,0)
229229
self.assertEqual(node.status(),NodeStatus.Uninitialized)
230230

231231
deftest_psql(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp