mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 05:51:45 -09:00
support/testing: use .assertRunOk() when possible
The BRTest() class implements an assertRunOk() method that does the very common work of running a command inside the emulator, and checking that it is successful. This commit changes all locations where this .assertRunOk() method can be used, instead of open-coding the same logic. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
committed by
Yann E. MORIN
parent
f579afc393
commit
afc1ed4d51
@@ -19,20 +19,16 @@ class TestTmux(infra.basetest.BRTest):
|
||||
self.emulator.login()
|
||||
|
||||
cmd = "tmux -V"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertRunOk(cmd)
|
||||
|
||||
cmd = "tmux -C </dev/null"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertRunOk(cmd)
|
||||
|
||||
cmd = "tmux split"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertRunOk(cmd)
|
||||
|
||||
cmd = "tmux new-window"
|
||||
_, exit_code = self.emulator.run(cmd)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertRunOk(cmd)
|
||||
|
||||
cmd = "tmux list-windows"
|
||||
output, exit_code = self.emulator.run(cmd)
|
||||
|
||||
Reference in New Issue
Block a user