Skip to content

Commit

Permalink
tests: project: Add test for update cloned option
Browse files Browse the repository at this point in the history
Add a test case for passing --cloned to west update or as a
configuration option.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
  • Loading branch information
pdgendt committed Feb 6, 2025
1 parent d0231ab commit b506184
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,28 @@ def test_update_narrow_depth1(tmpdir):
assert len(refs) == 1


def test_update_cloned(west_init_tmpdir):
# Manually update a single project
cmd('update Kconfiglib')

cmd('update --cloned')
assert (west_init_tmpdir / 'subdir' / 'Kconfiglib').check(dir=1)
assert (west_init_tmpdir / 'tagged_repo').check(dir=0)
assert (west_init_tmpdir / 'net-tools').check(dir=0)

cmd('config update.cloned true')
cmd('update')
assert (west_init_tmpdir / 'subdir' / 'Kconfiglib').check(dir=1)
assert (west_init_tmpdir / 'tagged_repo').check(dir=0)
assert (west_init_tmpdir / 'net-tools').check(dir=0)

cmd('config update.cloned false')
cmd('update')
assert (west_init_tmpdir / 'subdir' / 'Kconfiglib').check(dir=1)
assert (west_init_tmpdir / 'tagged_repo').check(dir=1)
assert (west_init_tmpdir / 'net-tools').check(dir=1)


def test_init_again(west_init_tmpdir):
# Test that 'west init' on an initialized tmpdir errors out
# with a message that indicates it's already initialized.
Expand Down

0 comments on commit b506184

Please sign in to comment.