blob: cd7b7397d1dcf913830625de6b435343354cb7e3 [file] [log] [blame]
Ryan Cui47f80e42013-04-01 19:01:54 -07001# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Don Garrett25f309a2014-03-19 14:02:12 -07005"""Unittests for cros."""
6
Mike Frysinger383367e2014-09-16 15:06:17 -04007from __future__ import print_function
8
Ralph Nathan1fc77f22015-04-21 15:05:48 -07009from chromite.lib import commandline
Ryan Cui47f80e42013-04-01 19:01:54 -070010from chromite.lib import cros_test_lib
Ryan Cui47f80e42013-04-01 19:01:54 -070011from chromite.scripts import cros
12
13
Don Garrett4c2b9172015-10-09 13:27:44 -070014class RunScriptTest(cros_test_lib.MockTempDirTestCase):
Ryan Cui47f80e42013-04-01 19:01:54 -070015 """Test the main functionality."""
16
17 def setUp(self):
Ryan Cui47f80e42013-04-01 19:01:54 -070018 self.PatchObject(cros, '_RunSubCommand', autospec=True)
19
David Pursellc7ba7842015-07-08 10:48:41 -070020 def testDefaultLogLevel(self):
21 """Test that the default log level is set to notice."""
Ralph Nathan1fc77f22015-04-21 15:05:48 -070022 arg_parser = self.PatchObject(commandline, 'ArgumentParser',
23 return_value=commandline.ArgumentParser())
24 cros.GetOptions({})
Ralph Nathan38372f42015-05-19 15:56:25 -070025 arg_parser.assert_called_with(caching=True, default_log_level='notice')