Function which verifies that user has ran "git submodule update --init --recursive" in the root of the directory and that the "st2tests/st2tests/fixtures/packs/test" git repo submodule used by the tests is checked out.
()
| 439 | |
| 440 | |
| 441 | def assert_submodules_are_checked_out(): |
| 442 | """ |
| 443 | Function which verifies that user has ran "git submodule update --init --recursive" in the |
| 444 | root of the directory and that the "st2tests/st2tests/fixtures/packs/test" git repo submodule |
| 445 | used by the tests is checked out. |
| 446 | """ |
| 447 | # late import to prevent circular import |
| 448 | from st2tests.fixtures.packs.test_content_version_fixture.fixture import PACK_PATH |
| 449 | |
| 450 | pack_path = os.path.abspath(PACK_PATH) |
| 451 | submodule_git_dir_or_file_path = os.path.join(pack_path, ".git") |
| 452 | |
| 453 | # NOTE: In newer versions of git, that .git is a file and not a directory |
| 454 | if not os.path.exists(submodule_git_dir_or_file_path): |
| 455 | raise ValueError(GIT_SUBMODULES_NOT_CHECKED_OUT_ERROR % (pack_path)) |
| 456 | |
| 457 | return True |