diff --git a/test_whisper.py b/test_whisper.py index e7f2a11c..fa76c095 100755 --- a/test_whisper.py +++ b/test_whisper.py @@ -401,7 +401,6 @@ def test_merge_empty(self): whisper.merge(testdb_a, testdb_b) - def test_merge_bad_archive_config(self): testdb = "test-%s" % self.filename @@ -775,15 +774,14 @@ def test_fetch_with_archive_to_select(self): retention = [(1, 60), (60, 60), (3600, 24), (86400, 365)] whisper.create(self.filename, retention) - archives = ["1s","1m","1h","1d"] + archives = ["1s", "1m", "1h", "1d"] for i in range(len(archives)): fetch = whisper.fetch(self.filename, 0, archiveToSelect=archives[i]) self.assertEqual(fetch[0][2], retention[i][0]) # check time range - self.assertEqual(fetch[0][1] - fetch[0][0], - retention[-1][0] * retention[-1][1]) + self.assertEqual(fetch[0][1] - fetch[0][0], retention[-1][0] * retention[-1][1]) with AssertRaisesException(ValueError("Invalid granularity: 2")): fetch = whisper.fetch(self.filename, 0, archiveToSelect="2s") diff --git a/whisper.py b/whisper.py index 5b971a85..433da09e 100644 --- a/whisper.py +++ b/whisper.py @@ -921,9 +921,9 @@ def file_fetch(fh, fromTime, untilTime, now=None, archiveToSelect=None): diff = now - fromTime - #Parse granularity if requested + # Parse granularity if requested if archiveToSelect: - retentionStr = str(archiveToSelect)+":1" + retentionStr = str(archiveToSelect) + ":1" archiveToSelect = parseRetentionDef(retentionStr)[0] for archive in header['archives']: @@ -936,7 +936,7 @@ def file_fetch(fh, fromTime, untilTime, now=None, archiveToSelect=None): break if archiveToSelect and not archive: - raise ValueError("Invalid granularity: %s" %(archiveToSelect)) + raise ValueError("Invalid granularity: %s" % (archiveToSelect)) return __archive_fetch(fh, archive, fromTime, untilTime)