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.
6 """Unittests for cros_list_overlays.py"""
8 from __future__ import print_function
14 sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
16 from chromite.lib import cros_test_lib
17 from chromite.lib import portage_util
18 from chromite.scripts import cros_list_overlays
21 class ListOverlaysTest(cros_test_lib.MockTestCase):
22 """Tests for main()"""
25 self.pfind_mock = self.PatchObject(portage_util, 'FindPrimaryOverlay')
26 self.find_mock = self.PatchObject(portage_util, 'FindOverlays')
29 """Basic sanity check"""
30 cros_list_overlays.main([])
32 def testPrimary(self):
33 """Basic primary check"""
34 cros_list_overlays.main(['--primary_only', '--board', 'foo'])
37 if __name__ == '__main__':
38 cros_test_lib.main(level=logging.INFO)