Mike Frysinger | 9e77380 | 2023-08-31 11:00:48 -0400 | [diff] [blame] | 1 | # Copyright 2023 The ChromiumOS Authors |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Tests for setup_board.""" |
| 6 | |
| 7 | from unittest import mock |
| 8 | |
| 9 | import pytest |
| 10 | |
| 11 | from chromite.scripts import setup_board |
| 12 | |
| 13 | |
| 14 | @mock.patch("chromite.service.sysroot.SetupBoard", return_value=None) |
| 15 | def test_main(_, tmp_path): |
| 16 | """Smoke test.""" |
| 17 | # Missing --board fails. |
| 18 | with pytest.raises(SystemExit): |
| 19 | setup_board.main([]) |
| 20 | |
| 21 | # Point to an empty root just in case we try to touch something. |
| 22 | setup_board.main( |
| 23 | ["-b", "amd64-generic", "--board-root", str(tmp_path / "empty")] |
| 24 | ) |