-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hdc: reformat files & small fixes (#127)
Signed-off-by: Antonio Paolillo <[email protected]>
- Loading branch information
Showing
2 changed files
with
77 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
#!/usr/bin/env python3 | ||
# SPDX-License-Identifier: MIT | ||
""" | ||
Module to test the HDC api basics | ||
""" | ||
|
||
import os | ||
from benchkit.hdc import * | ||
|
||
HOST_FILE = ".gitignore" | ||
TMP_FILE = "cloned-gitignore" | ||
TARGET_FILE = "/storage/media/100/local/testing/.gitignore" | ||
|
||
def main() -> None: | ||
device = OpenHarmonyDeviceConnector.query_devices(lambda _: True)[0] | ||
print(device) | ||
|
||
bridge = OpenHarmonyDeviceConnector(device) | ||
output = bridge._target_shell_out("cd data && ls") | ||
print(output) | ||
|
||
bridge.push(HOST_FILE, TARGET_FILE) | ||
bridge.pull(TARGET_FILE, TMP_FILE) | ||
|
||
f = open(TMP_FILE, 'r') | ||
content=f.read() | ||
print(content) | ||
f.close() | ||
|
||
os.remove(f.name) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
#!/usr/bin/env python3 | ||
# SPDX-License-Identifier: MIT | ||
""" | ||
Module to test the HDC api basics | ||
""" | ||
|
||
import os | ||
|
||
from benchkit.hdc import * | ||
|
||
HOST_FILE = ".gitignore" | ||
TMP_FILE = "cloned-gitignore" | ||
TARGET_FILE = "/storage/media/100/local/testing/.gitignore" | ||
|
||
|
||
def main() -> None: | ||
device = OpenHarmonyDeviceConnector.query_devices(lambda _: True)[0] | ||
print(device) | ||
|
||
bridge = OpenHarmonyDeviceConnector(device) | ||
output = bridge._target_shell_out("cd data && ls") | ||
print(output) | ||
|
||
bridge.push(HOST_FILE, TARGET_FILE) | ||
bridge.pull(TARGET_FILE, TMP_FILE) | ||
|
||
f = open(TMP_FILE, "r") | ||
content = f.read() | ||
print(content) | ||
f.close() | ||
|
||
os.remove(f.name) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |