switch to standard assert helpers rather than ad-hoc versions
The native versions provide better error messages and are simpler.
* assertTrue(os.path.exists(...)) -> assertExists(...)
* assertTrue(... is None) -> assertIsNone(...)
BUG=None
TEST=unittests still pass
Change-Id: Iba3c1bd164fa873409481c8eec6018f4b744d166
Reviewed-on: https://chromium-review.googlesource.com/828083
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Shuo-Peng Liao <deanliao@chromium.org>
diff --git a/scripts/cros_sdk_unittest.py b/scripts/cros_sdk_unittest.py
index 2c875a2..4e5a5af 100644
--- a/scripts/cros_sdk_unittest.py
+++ b/scripts/cros_sdk_unittest.py
@@ -155,7 +155,7 @@
code, _ = self._crosSdk(['--snapshot-create', 'test'])
self.assertEqual(code, 0)
- self.assertTrue(os.path.exists(self.chroot_version_file))
+ self.assertExists(self.chroot_version_file)
code, output = self._crosSdk(['--snapshot-list'])
self.assertEqual(code, 0)
@@ -214,7 +214,7 @@
code, _ = self._crosSdk(['--snapshot-restore', 'test'])
self.assertEqual(code, 0)
self.assertTrue(cros_build_lib.MountChroot(self.chroot, create=False))
- self.assertTrue(os.path.exists(test_file))
+ self.assertExists(test_file)
code, output = self._crosSdk(['--snapshot-list'])
self.assertEqual(code, 0)
@@ -234,7 +234,7 @@
'--snapshot-create', 'test'])
self.assertEqual(code, 0)
self.assertTrue(cros_build_lib.MountChroot(self.chroot, create=False))
- self.assertTrue(os.path.exists(test_file))
+ self.assertExists(test_file)
code, output = self._crosSdk(['--snapshot-list'])
self.assertEqual(code, 0)
@@ -260,7 +260,7 @@
code, _ = self._crosSdk(['--snapshot-restore', 'test'])
self.assertNotEqual(code, 0)
# Failed restore leaves the existing snapshot in place.
- self.assertTrue(os.path.exists(test_file))
+ self.assertExists(test_file)
def testRestoreSnapshotMountsAsNeeded(self):
with sudo.SudoKeepAlive():
@@ -276,7 +276,7 @@
code, _ = self._crosSdk(['--snapshot-restore', 'test'])
self.assertEqual(code, 0)
- self.assertTrue(os.path.exists(test_file))
+ self.assertExists(test_file)
code, output = self._crosSdk(['--snapshot-list'])
self.assertEqual(code, 0)