Multithreading #66 (#76)

* feat(multihreading): each url has it's own thread

* Fixing broken unit tests

* Improving readability when there are multiple URLs registerd and creating new action to upload metrics

* Improving error message when there's no file found

* Bumping the version

Co-authored-by: Alex Berenshtein <aberenshtein@yotpo.com>
This commit is contained in:
mtakaki
2020-01-05 10:25:06 -08:00
committed by GitHub
parent 9a73063a6f
commit a13a42d51c
7 changed files with 188 additions and 116 deletions

View File

@@ -3,6 +3,7 @@ import sys
import unittest
import mock
from yaml import load, SafeLoader
sys.modules['schedule'] = mock.Mock()
from cachet_url_monitor.scheduler import Agent, Scheduler
@@ -26,7 +27,7 @@ class AgentTest(unittest.TestCase):
def test_start(self):
every = sys.modules['schedule'].every
self.configuration.data = {'frequency': 5}
self.configuration.endpoint = {'frequency': 5}
self.agent.start()
@@ -45,7 +46,7 @@ class SchedulerTest(unittest.TestCase):
mock_requests.get = get
self.scheduler = Scheduler('config.yml')
self.scheduler = Scheduler(load(open('config.yml', 'r'), SafeLoader), 0)
def test_init(self):
assert self.scheduler.stop == False