| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import unittest | 5 import unittest |
| 6 from infra_libs.event_mon import checkouts | 6 from infra_libs.event_mon import checkouts |
| 7 | 7 |
| 8 | 8 |
| 9 class TestParseRevInfo(unittest.TestCase): | 9 class TestParseRevInfo(unittest.TestCase): |
| 10 def test_empty_file(self): | 10 def test_empty_file(self): |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 testing_support: https://chromium.googlesource.com/infra/testing/testing_support
.git@134e350cb5c6bfc14e8b8d0f0f0508ffc769d3bb | 50 testing_support: https://chromium.googlesource.com/infra/testing/testing_support
.git@134e350cb5c6bfc14e8b8d0f0f0508ffc769d3bb |
| 51 """ | 51 """ |
| 52 revinfo = checkouts.parse_revinfo(output) | 52 revinfo = checkouts.parse_revinfo(output) |
| 53 # Check some invariants | 53 # Check some invariants |
| 54 self.assertTrue(len(revinfo) > 0, 'revinfo should contain values') | 54 self.assertTrue(len(revinfo) > 0, 'revinfo should contain values') |
| 55 for v in revinfo.itervalues(): | 55 for v in revinfo.itervalues(): |
| 56 self.assertEqual(len(v), 2) | 56 self.assertEqual(len(v), 2) |
| 57 self.assertIn('://', v['source_url'], | 57 self.assertIn('://', v['source_url'], |
| 58 msg='"://" not in url string. Got %s' % v['source_url']) | 58 msg='"://" not in url string. Got %s' % v['source_url']) |
| 59 self.assertIn(v['source_url'].split('://')[0], ('https', 'svn')) | 59 self.assertIn(v['source_url'].split('://')[0], ('https', 'svn')) |
| OLD | NEW |