summaryrefslogtreecommitdiff
path: root/util/ec3po
diff options
context:
space:
mode:
authorRuben Rodriguez Buchillon <coconutruben@chromium.org>2021-01-22 18:24:03 -0800
committerCommit Bot <commit-bot@chromium.org>2021-01-23 08:21:51 +0000
commit2ff2c55ad44c2df96d14e08899c73bf510bacaa0 (patch)
treec0058dea0565eab98aca5bc1b8a674025b4395fe /util/ec3po
parent3a9d4491044ea7cbef59c641c12efb65e5b46558 (diff)
downloadchrome-ec-2ff2c55ad44c2df96d14e08899c73bf510bacaa0.tar.gz
ec3po: fix python3 related unittest failures
The new way to open the ttys was making 2 tests fail. This change addresses that by aligning the expectations with the actual calls. BRANCH=None BUG=b:173654272 TEST=./util/ec3po/run_tests.sh Ran 44 tests in 0.089s OK Change-Id: Ib550ab31436a8da093ec0af2bb0c61bb345647b2 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2645699 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
Diffstat (limited to 'util/ec3po')
-rwxr-xr-xutil/ec3po/interpreter_unittest.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/ec3po/interpreter_unittest.py b/util/ec3po/interpreter_unittest.py
index 974b6640f3..107800dd38 100755
--- a/util/ec3po/interpreter_unittest.py
+++ b/util/ec3po/interpreter_unittest.py
@@ -63,7 +63,7 @@ class TestEnhancedECBehaviour(unittest.TestCase):
case.
"""
# The interpreter init should open the EC UART PTY.
- expected_ec_calls = [mock.call(self.tempfile.name, 'ab+')]
+ expected_ec_calls = [mock.call(self.tempfile.name, 'r+b', buffering=0)]
# Have a command come in the command pipe. The first command will be an
# interrogation to determine if the EC is enhanced or not.
self.cmd_pipe_user.send(interpreter.EC_SYN)
@@ -128,7 +128,7 @@ class TestEnhancedECBehaviour(unittest.TestCase):
case.
"""
# The interpreter init should open the EC UART PTY.
- expected_ec_calls = [mock.call(self.tempfile.name, 'ab+')]
+ expected_ec_calls = [mock.call(self.tempfile.name, 'r+b', buffering=0)]
# Have a command come in the command pipe. The first command will be an
# interrogation to determine if the EC is enhanced or not.
self.cmd_pipe_user.send(interpreter.EC_SYN)