Add attributes to Mocked classes

This commit is contained in:
Feike Steenbergen
2016-01-29 13:29:51 +01:00
parent 704b29e686
commit bce96df177
3 changed files with 8 additions and 0 deletions
+3
View File
@@ -16,6 +16,8 @@ class MockPostgresql(Mock):
name = 'test'
state = 'running'
role = 'master'
server_version = '999999'
scope = 'dummy'
def connection(self):
return psycopg2_connect()
@@ -51,6 +53,7 @@ class MockPatroni:
ha = MockHa()
dcs = Mock()
tags = {}
version = '0.00'
class MockRequest:
+3
View File
@@ -40,6 +40,9 @@ class MockResponse:
class MockPostgresql(Mock):
server_version = '999999'
scope = 'dummy'
def last_operation(self):
return '0'
+2
View File
@@ -48,6 +48,8 @@ class MockPostgresql(Mock):
role = 'replica'
state = 'running'
connection_string = 'postgres://foo@bar/postgres'
server_version = '999999'
scope = 'dummy'
def is_healthy(self):
return True