Chromium Code Reviews| 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() |