1
0
mirror of https://github.com/bspeice/metrik synced 2026-06-11 07:41:40 -04:00

Make sure there's a newline for the cron jobs

This commit is contained in:
Bradlee Speice
2016-08-24 07:09:43 -04:00
parent 0eb0966729
commit 7e81f78a6d
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
__version__ = '0.2.2' __version__ = '0.2.3'
__release__ = __version__ __release__ = __version__
+1 -1
View File
@@ -29,7 +29,7 @@ def build_cron_file():
cron_string + ' ' + EXEC + ' ' + FLOW_FLAG + ' ' + flow_name cron_string + ' ' + EXEC + ' ' + FLOW_FLAG + ' ' + flow_name
) )
return '\n'.join(cron_strings) return '\n'.join(cron_strings) + '\n'
def list_flows(): def list_flows():
+6 -1
View File
@@ -1,7 +1,7 @@
from unittest import TestCase from unittest import TestCase
from datetime import datetime from datetime import datetime
from metrik.batch import flows from metrik.batch import flows, build_cron_file
class BatchTest(TestCase): class BatchTest(TestCase):
@@ -11,3 +11,8 @@ class BatchTest(TestCase):
for flow_name, flow_class in flows.items(): for flow_name, flow_class in flows.items():
assert flow_class(present=present, assert flow_class(present=present,
live=live).get_schedule() is not None live=live).get_schedule() is not None
def test_cron_string(self):
cron_string = build_cron_file()
assert len(cron_string.split('\n')) == len(flows) + 1
assert cron_string[-1] == '\n'