blob: 54913e511387cff070b12a78b82774b49933ed1e [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""API Config unit tests."""
from chromite.api.api_config import ApiConfig
from chromite.lib import cros_test_lib
class ApiConfigTest(cros_test_lib.TestCase):
"""ApiConfig tests."""
def test_do_validation(self):
"""Sanity check for the do validation property being True."""
# Should validate by default, and when only doing validation.
config = ApiConfig()
config = ApiConfig(call_type=ApiConfig.CALL_TYPE_VALIDATE_ONLY)
def test_no_do_validation(self):
"""Sanity check for skipping validation for mock calls."""
config = ApiConfig(call_type=ApiConfig.CALL_TYPE_MOCK_SUCCESS)
config = ApiConfig(call_type=ApiConfig.CALL_TYPE_MOCK_FAILURE)