Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: native_client_sdk/src/tools/tests/getos_test.py

Issue 506863005: [NaCl SDK] getos.py now checks against the Cr-Commit-Position. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sbc-nacl-sdk-fix-getos-tests
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/tools/getos.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/tests/getos_test.py
diff --git a/native_client_sdk/src/tools/tests/getos_test.py b/native_client_sdk/src/tools/tests/getos_test.py
index 9004bd9e0f08210af2c2a793b27e01fc7b578497..48ee4a1e16b545b01146d3b3cc3643d2781fad1b 100755
--- a/native_client_sdk/src/tools/tests/getos_test.py
+++ b/native_client_sdk/src/tools/tests/getos_test.py
@@ -117,7 +117,7 @@ class TestGetosWithTempdir(TestCaseExtended):
def testGetSDKVersion(self):
"""correctly parses README to find SDK version."""
- expected_version = (16, '196')
+ expected_version = (16, '0a1b2c3d')
with open(os.path.join(self.tempdir, 'README'), 'w') as out:
out.write('Version: %s\n' % expected_version[0])
out.write('Chrome Revision: %s\n' % expected_version[1])
@@ -125,6 +125,28 @@ class TestGetosWithTempdir(TestCaseExtended):
version = getos.GetSDKVersion()
self.assertEqual(version, expected_version)
+ def testCheckVersion(self):
+ """correctly rejects SDK versions earlier than the required one."""
+ actual_version = (16, '0a1b2c3d')
binji 2014/08/27 01:05:02 See https://codereview.chromium.org/507883003/ I
Matt Giuca 2014/08/27 01:17:50 Oh OK, cool. I was expecting we would end up with
+ with open(os.path.join(self.tempdir, 'README'), 'w') as out:
+ out.write('Version: %s\n' % actual_version[0])
+ out.write('Chrome Revision: %s\n' % actual_version[1])
+
+ required_version = (15, 196)
+ getos.CheckVersion(required_version)
+
+ # Note: The revision part is currently ignored due to Git; see
+ # http://crbug.com/406993.
+ required_version = (16, 196)
+ getos.CheckVersion(required_version)
+
+ required_version = (17, 196)
+ self.assertRaisesRegexp(
+ getos.Error,
+ r'SDK version too old \(current: 16, required: 17\)',
+ getos.CheckVersion,
+ required_version)
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « native_client_sdk/src/tools/getos.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698