remove line too long warnings where possible.

This commit is contained in:
Oleksii Kliukin
2015-08-07 16:35:00 +02:00
parent 5d1d59a42b
commit 164b5760a4
2 changed files with 3 additions and 4 deletions
+3 -1
View File
@@ -74,6 +74,7 @@ class Restore(object):
return 1
return ret
class WALERestore(Restore):
def __init__(self, scope, role, datadir, connstring, env=None):
@@ -133,7 +134,8 @@ class WALERestore(Restore):
threshold_backup_size_percentage = self.wal_e.threshold_backup_size_percentage
try:
latest_backup = subprocess.check_output(self.wal_e.cmd.split() + ['backup-list', '--detail', 'LATEST'], env=self.env)
latest_backup = subprocess.check_output(self.wal_e.cmd.split() + ['backup-list', '--detail', 'LATEST'],
env=self.env)
# name last_modified expanded_size_bytes wal_segment_backup_start wal_segment_offset_backup_start
# wal_segment_backup_stop wal_segment_offset_backup_stop
# base_00000001000000000000007F_00000040 2015-05-18T10:13:25.000Z
-3
View File
@@ -50,7 +50,6 @@ class TestRestore(unittest.TestCase):
self.assertEqual(ret, 1)
@patch('os.access', MagicMock(return_value=True))
@patch('os.makedirs', MagicMock(return_value=True))
@patch('os.path.exists', MagicMock(return_value=True))
@@ -76,7 +75,6 @@ class TestWALERestore(unittest.TestCase):
self.wale_restore.setup()
self.assertFalse(self.wale_restore.init_error)
# have to redefine the class-level os.access mock inside the function
# since the class-level mock will be applied after the function level one.
@patch('os.access', return_value=False)
@@ -85,7 +83,6 @@ class TestWALERestore(unittest.TestCase):
self.wale_restore.setup()
self.assertTrue(self.wale_restore.init_error)
# The 3 tests above only differ with the mock function instead of a subprocess call
# in the first one, subprocess call should return success only for wal-e command,
# checking the primary use-case of restoring from WAL-E backup.