blob: c1a62ce0660ce361b53e5f0b2b072325cfb71126 [file] [log] [blame]
Mike Frysinger9e773802023-08-31 11:00:48 -04001# 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
7from unittest import mock
8
9import pytest
10
11from chromite.scripts import setup_board
12
13
14@mock.patch("chromite.service.sysroot.SetupBoard", return_value=None)
15def 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 )