blob: 47f8d2ae143855681b3406f7dd9c262018b6ee36 [file] [log] [blame]
Mike Frysingere58c0e22017-10-04 15:43:30 -04001# -*- coding: utf-8 -*-
Ryan Cui47f80e42013-04-01 19:01:54 -07002# Copyright (c) 2013 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
Don Garrett25f309a2014-03-19 14:02:12 -07006"""Unittests for cros."""
7
Mike Frysinger383367e2014-09-16 15:06:17 -04008from __future__ import print_function
9
Ralph Nathan1fc77f22015-04-21 15:05:48 -070010from chromite.lib import commandline
Ryan Cui47f80e42013-04-01 19:01:54 -070011from chromite.lib import cros_test_lib
Ryan Cui47f80e42013-04-01 19:01:54 -070012from chromite.scripts import cros
13
14
Don Garrett4c2b9172015-10-09 13:27:44 -070015class RunScriptTest(cros_test_lib.MockTempDirTestCase):
Ryan Cui47f80e42013-04-01 19:01:54 -070016 """Test the main functionality."""
17
18 def setUp(self):
Ryan Cui47f80e42013-04-01 19:01:54 -070019 self.PatchObject(cros, '_RunSubCommand', autospec=True)
20
David Pursellc7ba7842015-07-08 10:48:41 -070021 def testDefaultLogLevel(self):
22 """Test that the default log level is set to notice."""
Ralph Nathan1fc77f22015-04-21 15:05:48 -070023 arg_parser = self.PatchObject(commandline, 'ArgumentParser',
24 return_value=commandline.ArgumentParser())
25 cros.GetOptions({})
Ralph Nathan38372f42015-05-19 15:56:25 -070026 arg_parser.assert_called_with(caching=True, default_log_level='notice')