Skip to content

Commit

Permalink
all pytests now passing
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 4, 2024
1 parent 143abac commit 62a338b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions git_fleximod/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def _add_remote(self, git):
git.git_operation("remote", "add", newremote, self.url)
return newremote

def toplevel(self):
"""
Returns True if the submodule is Toplevel (either Required or Optional)
"""
return True if "Top" in self.fxrequired else False

def sparse_checkout(self):
"""
Performs a sparse checkout of the submodule.
Expand Down
9 changes: 5 additions & 4 deletions tests/test_e_complex_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def test_complex_update(git_fleximod, complex_update, logger):
assert("AlwaysRequired not checked out, aligned at tag MPIserial_2.4.0" in status.stdout)
assert("Complex not checked out, out of sync at tag testtag02, expected tag is testtag3" in status.stdout)
assert("AlwaysOptional not checked out, out of sync at tag None, expected tag is MPIserial_2.3.0" in status.stdout)
print(f"status before is {status.stdout}")

# This should checkout and update test_submodule and complex_sub
result = git_fleximod(complex_update, "update")
Expand All @@ -20,7 +19,7 @@ def test_complex_update(git_fleximod, complex_update, logger):
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 testtag3" in status.stdout)
print(f"status after is {status.stdout}")

# now check the complex_sub
root = (complex_update / "modules" / "complex")
assert(not (root / "libraries" / "gptl" / ".git").exists())
Expand Down Expand Up @@ -59,9 +58,11 @@ def test_complex_update(git_fleximod, complex_update, logger):
root = (complex_update / "modules" / "complex" )
assert(not (root / "libraries" / "gptl" / ".git").exists())
assert(not (root / "libraries" / "mpi-serial" / ".git").exists())
assert((root / "modules" / "mpi-serial" / ".git").exists())
assert((root / "modules" / "mpi-serial2" / ".git").exists())
assert(not (root / "modules" / "mpi-serial" / ".git").exists())
assert((root / "modules" / "mpi-serialAR" / ".git").exists())
assert((root / "modules" / "mpi-serialSAR" / ".git").exists())
assert((root / "modules" / "mpi-sparse" / ".git").exists())
assert((root / "modules" / "mpi-serial2" / ".git").exists())
assert((root / "modules" / "mpi-sparse" / "m4").exists())
assert(not (root / "modules" / "mpi-sparse" / "README").exists())

Expand Down

0 comments on commit 62a338b

Please sign in to comment.