Skip to content

Commit

Permalink
Increase the tests coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyklyukin committed Jan 26, 2016
1 parent 3443755 commit aa350b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/test_patroni.py
Expand Up @@ -80,3 +80,8 @@ def test_nofailover(self):
self.assertTrue(self.p.nofailover)
self.p.tags['nofailover'] = None
self.assertFalse(self.p.nofailover)

def test_replicatefrom(self):
self.assertIsNone(self.p.replicatefrom)
self.p.tags['replicatefrom'] = 'foo'
self.assertEqual(self.p.replicatefrom, 'foo')
6 changes: 5 additions & 1 deletion tests/test_wale_restore.py
Expand Up @@ -3,7 +3,7 @@
import os
import psycopg2
import subprocess
from patroni.scripts.wale_restore import WALERestore
from patroni.scripts.wale_restore import WALERestore, main


def fake_cursor_fetchone(*args, **kwargs):
Expand Down Expand Up @@ -91,3 +91,7 @@ def test_run(self):
with patch.object(self.wale_restore, 'should_use_s3_to_create_replica', MagicMock(return_value=True)):
with patch.object(self.wale_restore, 'create_replica_with_s3', MagicMock(return_value=0)):
self.assertEqual(self.wale_restore.run(), 0)

def test_main(self):
with patch('sys.exit', MagicMock(return_value=0)):
main()

0 comments on commit aa350b7

Please sign in to comment.