Passed
Push — master ( 1bf5cf...d6ff14 )
by Dave
02:20
created

tests.func_telegram   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 0
1
'''test telegram api'''
2
from backend.fcmapp import ApplicationService, ComponentName
3
4
APP = ApplicationService(ComponentName.fullcycle)
5
6
MESSAGE = 'Full Cycle Mining test {}'.format(APP.now())
7
if APP.configuration.is_enabled('telegram'):
8
    APP.telegram.sendmessage(MESSAGE)
9
else:
10
    print('telegram is not enabled in configuration')
11
12
if APP.configuration.is_enabled('camera'):
13
    FILEOUT = APP.camera.take_picture('fullcycle_camera.png')
14
    APP.telegram.sendphoto(FILEOUT)
15
else:
16
    print('camera is not enabled in configuration')
17
18
19
APP.shutdown()
20