tcl: add availability check (#35909)
This commit is contained in:
parent
c803ac7552
commit
e0ebb3f2b6
|
@ -111,6 +111,11 @@ class Tcl(BaseResource):
|
|||
|
||||
return {'data': stop}
|
||||
|
||||
def check_status(self):
|
||||
stop_object = Stop.objects.all().first()
|
||||
if stop_object:
|
||||
self.stop(stop_object.id)
|
||||
|
||||
def daily(self):
|
||||
super(Tcl, self).daily()
|
||||
start_update = timezone.now()
|
||||
|
|
|
@ -162,3 +162,8 @@ def test_stop_info(mocked_get, app, connector):
|
|||
assert resp.json['data']['passings'][0]['line_info']['ligne'] == 'B'
|
||||
assert resp.json['data']['passings_by_line'][0]['ligne'] == 'B'
|
||||
assert len(resp.json['data']['passings_by_line'][0]['passings']) == 2
|
||||
|
||||
@mock.patch('passerelle.utils.Request.get')
|
||||
def test_availability(mocked_get, app, connector):
|
||||
mocked_get.side_effect = tcl_responses
|
||||
connector.check_status()
|
||||
|
|
Loading…
Reference in New Issue