Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 """Unit tests for rietveld.py.""" | 6 """Unit tests for rietveld.py.""" |
| 7 | 7 |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 rietveld.Rietveld.parse_svn_properties( | 251 rietveld.Rietveld.parse_svn_properties( |
| 252 u'\nAdded: svn:mergeinfo\n' | 252 u'\nAdded: svn:mergeinfo\n' |
| 253 ' Merged /branches/chrome_webkit_merge_branch/third_party/' | 253 ' Merged /branches/chrome_webkit_merge_branch/third_party/' |
| 254 'libxml/xmldummy_mac.cc:r69-2775\n', | 254 'libxml/xmldummy_mac.cc:r69-2775\n', |
| 255 'foo')) | 255 'foo')) |
| 256 | 256 |
| 257 self.assertEquals( | 257 self.assertEquals( |
| 258 [], | 258 [], |
| 259 rietveld.Rietveld.parse_svn_properties(u'', 'foo')) | 259 rietveld.Rietveld.parse_svn_properties(u'', 'foo')) |
| 260 | 260 |
| 261 | |
| 262 # http://codereview.chromium.org/api/7834045/15001 | |
| 263 self.assertEquals( | |
| 264 [('svn:executable', '*'), ('svn:eol-style', 'LF')], | |
| 265 rietveld.Rietveld.parse_svn_properties( | |
| 266 '\n' | |
| 267 'Added: svn:executable\n' | |
| 268 ' + *\n' | |
|
M-A Ruel
2011/09/08 18:37:58
e.g. I thought there was one more empty line in be
| |
| 269 'Added: svn:eol-style\n' | |
| 270 ' + LF\n', | |
| 271 'foo')) | |
| 272 | |
| 273 def test_bad_svn_properties(self): | |
| 261 try: | 274 try: |
| 262 rietveld.Rietveld.parse_svn_properties(u'\n', 'foo') | 275 rietveld.Rietveld.parse_svn_properties(u'\n', 'foo') |
| 263 self.fail() | 276 self.fail() |
| 264 except rietveld.patch.UnsupportedPatchFormat, e: | 277 except rietveld.patch.UnsupportedPatchFormat, e: |
| 265 self.assertEquals('foo', e.filename) | 278 self.assertEquals('foo', e.filename) |
| 266 # TODO(maruel): Change with no diff, only svn property change: | 279 # TODO(maruel): Change with no diff, only svn property change: |
| 267 # http://codereview.chromium.org/6462019/ | 280 # http://codereview.chromium.org/6462019/ |
| 268 | 281 |
| 269 | 282 |
| 270 if __name__ == '__main__': | 283 if __name__ == '__main__': |
| 271 logging.basicConfig(level=logging.ERROR) | 284 logging.basicConfig(level=logging.ERROR) |
| 272 unittest.main() | 285 unittest.main() |
| OLD | NEW |