~aleteoryx/muditaos

muditaos/test/eq_setup.py -rw-r--r-- 725 bytes
a405cad6Aleteoryx trim readme 5 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
# Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

from harness.harness import Harness
from harness.api.developermode import SetEQ

import sys
import copy

harness = Harness.from_detect()

# pass EQ json file as an argument of this script. It can be both absolute or relative path.

file_path = sys.argv[1]
file_data = open(file_path,"r")
file_text = file_data.read()
file_data.close()

file_name = file_path.split('/')[-1]
print("Overriding "+file_name+" ...")
print("File data: \n"+file_text)
cmd = SetEQ(file_name,file_text)
ret = cmd.run(harness)
print("result: " + "OK" if ret.response.status == 200 else "Error!")