Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / chromite / scripts / cros_list_overlays_unittest.py
1 #!/usr/bin/python
2 # Copyright 2014 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Unittests for cros_list_overlays.py"""
7
8 from __future__ import print_function
9
10 import logging
11 import os
12 import sys
13
14 sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
15                                 '..', '..'))
16 from chromite.lib import cros_test_lib
17 from chromite.lib import portage_util
18 from chromite.scripts import cros_list_overlays
19
20
21 class ListOverlaysTest(cros_test_lib.MockTestCase):
22   """Tests for main()"""
23
24   def setUp(self):
25     self.pfind_mock = self.PatchObject(portage_util, 'FindPrimaryOverlay')
26     self.find_mock = self.PatchObject(portage_util, 'FindOverlays')
27
28   def testSmoke(self):
29     """Basic sanity check"""
30     cros_list_overlays.main([])
31
32   def testPrimary(self):
33     """Basic primary check"""
34     cros_list_overlays.main(['--primary_only', '--board', 'foo'])
35
36
37 if __name__ == '__main__':
38   cros_test_lib.main(level=logging.INFO)