diff --git a/tests/test_project.py b/tests/test_project.py index 322d4d39..7f9bcd42 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -379,7 +379,6 @@ def test_status(west_init_tmpdir): cmd('update Kconfiglib') - def test_forall(west_init_tmpdir): # Note that the 'echo' command is available in both Unix shells # and Windows .bat files. @@ -1521,6 +1520,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.