mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Merge branch 'restapi' of github.com:CyberDem0n/governor into features/refactoring
Conflicts: tests/test_postgresql.py
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import os
|
||||
import psycopg2
|
||||
import unittest
|
||||
import requests
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import unittest
|
||||
import yaml
|
||||
|
||||
from governor import Governor, main, sigchld_handler, sigterm_handler
|
||||
from test_ha import true, false
|
||||
from test_postgresql import Postgresql, os_system, psycopg2_connect
|
||||
from test_postgresql import Postgresql, subprocess_call, psycopg2_connect
|
||||
from test_etcd import requests_get, requests_put, requests_delete
|
||||
|
||||
if sys.hexversion >= 0x03000000:
|
||||
@@ -38,7 +39,7 @@ class TestGovernor(unittest.TestCase):
|
||||
|
||||
def set_up(self):
|
||||
self.touched = False
|
||||
os.system = os_system
|
||||
subprocess.call = subprocess_call
|
||||
psycopg2.connect = psycopg2_connect
|
||||
requests.get = requests_get
|
||||
requests.put = requests_put
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
|
||||
import os
|
||||
import psycopg2
|
||||
import unittest
|
||||
import shutil
|
||||
import subprocess
|
||||
import unittest
|
||||
|
||||
from helpers.etcd import Cluster, Member
|
||||
from helpers.postgresql import Postgresql
|
||||
@@ -14,7 +15,7 @@ def nop(*args, **kwargs):
|
||||
pass
|
||||
|
||||
|
||||
def os_system(cmd):
|
||||
def subprocess_call(cmd, shell=False):
|
||||
return 0
|
||||
|
||||
|
||||
@@ -107,7 +108,7 @@ class TestPostgresql(unittest.TestCase):
|
||||
super(TestPostgresql, self).__init__(method_name)
|
||||
|
||||
def set_up(self):
|
||||
os.system = os_system
|
||||
subprocess.call = subprocess_call
|
||||
shutil.copy = nop
|
||||
self.p = Postgresql({
|
||||
'name': 'test0',
|
||||
|
||||
Reference in New Issue
Block a user