1#!/usr/bin/env python3
2# Copyright 2024 The ChromiumOS Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6"""Tests for generate_android_cloud_config.py.
7
8This is run as part of `make runtests`, or `make runtestscripts` if you
9want something a little faster.
10"""
11
12import os
13import unittest
14
15from generate_android_cloud_config import _parse_flags
16from generate_android_cloud_config import _validate
17from generate_android_cloud_config import PKCS11_MODULE_PATH
18
19
20PKCS11_TEST_PATH = "test_path"
21
22
23class Test(unittest.TestCase):
24    """Basic unit test cases for generate_android_cloud_config.py"""
25
26    def test_input_args_default(self):
27        """Test default input arguments"""
28        args = _parse_flags([""])
29        self.assertEqual(args.output_dir, os.getcwd())
30
31    def test_validate_missing_pkcs11_module_path(self):
32        with self.assertRaises(SystemExit):
33            output_dir = _validate(_parse_flags([""]))
34
35
36if __name__ == "__main__":
37    unittest.main()
38