Skip to content

Commit

Permalink
update complex test
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jun 5, 2024
1 parent a34070b commit c304487
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def find_root_dir(filename=".gitmodules"):
attempt = dl / filename
if attempt.is_file():
return str(dl)
utils.fatal_error("No .gitmodules found in directory tree")
return None


def get_parser():
Expand Down
8 changes: 5 additions & 3 deletions git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,12 @@ def main():

logger.info("action is {} root_dir={} file_name={}".format(action, root_dir, file_name))

if not os.path.isfile(os.path.join(root_dir, file_name)):
file_path = utils.find_upwards(root_dir, file_name)
if not root_dir or not os.path.isfile(os.path.join(root_dir, file_name)):
if root_dir:
file_path = utils.find_upwards(root_dir, file_name)

if file_path is None:
if root_dir is None or file_path is None:
root_dir = "."
utils.fatal_error(
"No {} found in {} or any of it's parents".format(file_name, root_dir)
)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_d_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def test_complex_checkout(git_fleximod, complex_repo, logger):
assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout)
assert("ToplevelRequired not checked out, aligned at tag MPIserial_2.5.0" in status.stdout)
assert("AlwaysRequired not checked out, aligned at tag MPIserial_2.4.0" in status.stdout)
assert("Complex not checked out, aligned at tag testtag01" in status.stdout)
assert("Complex not checked out, aligned at tag testtag02" in status.stdout)
assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout)

# This should checkout and update test_submodule and complex_sub
Expand All @@ -18,7 +18,7 @@ def test_complex_checkout(git_fleximod, complex_repo, logger):
assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout)
assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout)
assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout)
assert("Complex at tag testtag01" in status.stdout)
assert("Complex at tag testtag02" in status.stdout)

# now check the complex_sub
root = (complex_repo / "modules" / "complex")
Expand All @@ -39,7 +39,7 @@ def test_complex_checkout(git_fleximod, complex_repo, logger):
assert("ToplevelOptional at tag v5.3.2" in status.stdout)
assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout)
assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout)
assert("Complex at tag testtag01" in status.stdout)
assert("Complex at tag testtag02" in status.stdout)
assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout)


Expand All @@ -51,7 +51,7 @@ def test_complex_checkout(git_fleximod, complex_repo, logger):
assert("ToplevelOptional at tag v5.3.2" in status.stdout)
assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout)
assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout)
assert("Complex at tag testtag01" in status.stdout)
assert("Complex at tag testtag02" in status.stdout)
assert("AlwaysOptional at tag MPIserial_2.3.0" in status.stdout)

# now check the complex_sub
Expand Down

0 comments on commit c304487

Please sign in to comment.