| 205 | @utils.requires_network |
| 206 | @pytest.mark.parametrize('depth', [0, 1]) |
| 207 | def test_oneshot_update_instance(repo: Repository, depth: int) -> None: |
| 208 | subrepo_file_path = Path(repo.workdir) / SUBM_PATH / 'master.txt' |
| 209 | assert not subrepo_file_path.exists() |
| 210 | sm = repo.submodules[SUBM_NAME] |
| 211 | sm.update(init=True, depth=depth) |
| 212 | assert subrepo_file_path.exists() |
| 213 | |
| 214 | sm_repo = sm.open() |
| 215 | if depth == 0: |
| 216 | sm_repo[SUBM_BOTTOM_SHA] # full history must be available |
| 217 | else: |
| 218 | with pytest.raises(KeyError): |
| 219 | sm_repo[SUBM_BOTTOM_SHA] # shallow clone |
| 220 | |
| 221 | |
| 222 | @utils.requires_network |