diff options
author | Hector Fernandez <hector@iatec.biz> | 2020-03-09 12:39:50 +0100 |
---|---|---|
committer | Hector Fernandez <hector@iatec.biz> | 2020-03-09 12:39:50 +0100 |
commit | c685367cbd6abf1c6ae442df759e39b25a907d3b (patch) | |
tree | 37a942f44512c7b567447de41b1ff2c8496898be /test-cli/test/helpers | |
parent | a03055f657d2e970e45e7ea2a3e66857f821eabd (diff) | |
download | board-c685367cbd6abf1c6ae442df759e39b25a907d3b.zip board-c685367cbd6abf1c6ae442df759e39b25a907d3b.tar.gz board-c685367cbd6abf1c6ae442df759e39b25a907d3b.tar.bz2 |
Fixed several test procedures.
Diffstat (limited to 'test-cli/test/helpers')
-rw-r--r-- | test-cli/test/helpers/amper.py | 1 | ||||
-rw-r--r-- | test-cli/test/helpers/changedir.py | 14 | ||||
-rwxr-xr-x | test-cli/test/helpers/usb.sh | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/test-cli/test/helpers/amper.py b/test-cli/test/helpers/amper.py index 45ec7db..ea719f6 100644 --- a/test-cli/test/helpers/amper.py +++ b/test-cli/test/helpers/amper.py @@ -1,6 +1,5 @@ import serial import scanf -import time class Amper(object): diff --git a/test-cli/test/helpers/changedir.py b/test-cli/test/helpers/changedir.py new file mode 100644 index 0000000..fad9ade --- /dev/null +++ b/test-cli/test/helpers/changedir.py @@ -0,0 +1,14 @@ +import os + + +class changedir: + """Context manager for changing the current working directory""" + def __init__(self, newPath): + self.newPath = os.path.expanduser(newPath) + + def __enter__(self): + self.savedPath = os.getcwd() + os.chdir(self.newPath) + + def __exit__(self, etype, value, traceback): + os.chdir(self.savedPath)
\ No newline at end of file diff --git a/test-cli/test/helpers/usb.sh b/test-cli/test/helpers/usb.sh index c8e6924..52ea4b2 100755 --- a/test-cli/test/helpers/usb.sh +++ b/test-cli/test/helpers/usb.sh @@ -11,4 +11,4 @@ for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do ) done -return 0 +exit 0 |