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

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

Issue 507673003: [NaCl SDK] Update getos.py tests to match new behaviour. (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 | « no previous file | 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')
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 124
125 version = getos.GetSDKVersion() 125 version = getos.GetSDKVersion()
126 self.assertEqual(version, expected_version) 126 self.assertEqual(version, expected_version)
127 127
128 128
129 if __name__ == '__main__': 129 if __name__ == '__main__':
130 unittest.main() 130 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698