File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -209,13 +209,15 @@ def delete(self, name):
209
209
"""
210
210
del self [name ]
211
211
212
- def replicate (self , source , target ):
212
+ def replicate (self , source , target , ** options ):
213
213
"""Replicate changes from the source database to the target database.
214
214
215
215
:param source: URL of the source database
216
216
:param target: URL of the target database
217
+ :param options: optional replication args, e.g. continuous=True
217
218
"""
218
219
data = {'source' : source , 'target' : target }
220
+ data .update (options )
219
221
resp , data = self .resource .post ('/_replicate' , data )
220
222
return data
221
223
Original file line number Diff line number Diff line change @@ -68,6 +68,13 @@ def test_replicate(self):
68
68
'python-tests' )
69
69
self .assertEquals (b [id ]['test' ], 'b' )
70
70
71
+ def test_replicate_continuous (self ):
72
+ a = self .server .create ('python-tests' )
73
+ b = self .server .create ('python-tests-a' )
74
+ result = self .server .replicate ('python-tests' , 'python-tests-a' , continuous = True )
75
+ self .assertEquals (result ['ok' ], True )
76
+ self .assertTrue ('_local_id' in result )
77
+
71
78
class DatabaseTestCase (unittest .TestCase ):
72
79
73
80
def setUp (self ):
You can’t perform that action at this time.
0 commit comments