~aleteoryx/muditaos

muditaos/test/pytest/module_apps/call_utils.py -rw-r--r-- 673 bytes
a405cad6Aleteoryx trim readme 6 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

import time
from harness import log
from harness.interface.defs import key_codes

def get_calllog_count(harness):
    body = {"count": True}
    return harness.endpoint_request("calllog", "get", body)["body"]["count"]

def select_call_button(harness, call_duration):
    # call
    log.info("Call duration = {}s, calling...".format(call_duration))
    harness.connection.send_key_code(key_codes["fnLeft"])
    time.sleep(call_duration)
    # hang up
    log.info("Hanging up...")
    harness.connection.send_key_code(key_codes["fnRight"])