progress bar: Add tests for deploy's progress bar.
The progress bar is dependent on strings in the output. This
test ensures that someone cannot change the strings without
making a similar change change the progress bar.
BUG=brillo:1015
TEST=`./cli/cros/tests/cros_vm_test`
Change-Id: Ie6d413262f58dae2f5ba0f8839b658c4a2c724c1
Reviewed-on: https://chromium-review.googlesource.com/272439
Reviewed-by: Yiming Chen <yimingc@chromium.org>
Commit-Queue: Ralph Nathan <ralphnathan@chromium.org>
Trybot-Ready: Ralph Nathan <ralphnathan@chromium.org>
Tested-by: Ralph Nathan <ralphnathan@chromium.org>
diff --git a/cli/deploy_unittest.py b/cli/deploy_unittest.py
index d8a14a1..ab500f7 100644
--- a/cli/deploy_unittest.py
+++ b/cli/deploy_unittest.py
@@ -344,7 +344,7 @@
def testBrilloDeployMergeOperation(self):
"""Test that BrilloDeployOperation works for merge."""
def func(queue):
- for event in op._merge_events:
+ for event in op.MERGE_EVENTS:
queue.get()
print(event)
@@ -356,12 +356,12 @@
op.Run(func, queue)
# Check that the progress bar prints correctly.
- self.AssertProgressBarAllEvents(len(op._merge_events))
+ self.AssertProgressBarAllEvents(len(op.MERGE_EVENTS))
def testBrilloDeployUnmergeOperation(self):
"""Test that BrilloDeployOperation works for unmerge."""
def func(queue):
- for event in op._unmerge_events:
+ for event in op.UNMERGE_EVENTS:
queue.get()
print(event)
@@ -373,4 +373,4 @@
op.Run(func, queue)
# Check that the progress bar prints correctly.
- self.AssertProgressBarAllEvents(len(op._unmerge_events))
+ self.AssertProgressBarAllEvents(len(op.UNMERGE_EVENTS))