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

Side by Side Diff: native_client_sdk/src/tools/tests/getos_test.py

Issue 495423010: [NaCl SDK] Update build_sdk.py to display Cr-Commit-Position in README. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « native_client_sdk/src/tools/getos.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import shutil 7 import shutil
8 import sys 8 import sys
9 import tempfile 9 import tempfile
10 import unittest 10 import unittest
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 self.patch = mock.patch.dict('os.environ', 110 self.patch = mock.patch.dict('os.environ',
111 {'NACL_SDK_ROOT': self.tempdir}) 111 {'NACL_SDK_ROOT': self.tempdir})
112 self.patch.start() 112 self.patch.start()
113 113
114 def tearDown(self): 114 def tearDown(self):
115 shutil.rmtree(self.tempdir) 115 shutil.rmtree(self.tempdir)
116 self.patch.stop() 116 self.patch.stop()
117 117
118 def testGetSDKVersion(self): 118 def testGetSDKVersion(self):
119 """correctly parses README to find SDK version.""" 119 """correctly parses README to find SDK version."""
120 expected_version = (16, '196') 120 expected_version = (16, '196', 'f00baacabba6e-refs/heads/master@{#100}')
121 with open(os.path.join(self.tempdir, 'README'), 'w') as out: 121 with open(os.path.join(self.tempdir, 'README'), 'w') as out:
122 out.write('Version: %s\n' % expected_version[0]) 122 out.write('Version: %s\n' % expected_version[0])
123 out.write('Chrome Revision: %s\n' % expected_version[1]) 123 out.write('Chrome Revision: %s\n' % expected_version[1])
124 out.write('Chrome Commit Position: %s\n' % expected_version[2])
124 125
125 version = getos.GetSDKVersion() 126 version = getos.GetSDKVersion()
126 self.assertEqual(version, expected_version) 127 self.assertEqual(version, expected_version)
127 128
128 129
129 if __name__ == '__main__': 130 if __name__ == '__main__':
130 unittest.main() 131 unittest.main()
OLDNEW
« 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