MCPcopy Create free account
hub / github.com/StackStorm/st2 / assert_submodules_are_checked_out

Function assert_submodules_are_checked_out

st2tests/st2tests/fixturesloader.py:441–457  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

439
440
441def 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

Callers 2

setUpClassMethod · 0.90
setUpClassMethod · 0.90

Calls 1

existsMethod · 0.80

Tested by 2

setUpClassMethod · 0.72
setUpClassMethod · 0.72