Skip to content

Commit

Permalink
Tidied up test folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory Barnes committed Sep 26, 2023
1 parent e66aaad commit 9a72101
Show file tree
Hide file tree
Showing 64 changed files with 66 additions and 1,463 deletions.
2 changes: 1 addition & 1 deletion tests/CreateHDF5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from bigplanet.bp_extract import *
from bigplanet.extract import *
from bigplanet import *
5 changes: 5 additions & 0 deletions tests/CreateHDF5/test_CreateHDF5.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def test_CreateHDF5():
# checks if the bpl files exist
assert os.path.isfile(file) == True

shutil.rmtree(path / "BP_CreateHDF5")
os.remove(path / ".BP_CreateHDF5")
os.remove(path / ".BP_CreateHDF5_BPL")
os.remove(path / "BP_CreateHDF5.bpa")
os.remove(path / "BP_CreateHDF5.md5")

if __name__ == "__main__":
test_CreateHDF5()
2 changes: 1 addition & 1 deletion tests/ExtractArchive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from bigplanet.bp_extract import *
from bigplanet.extract import *
from bigplanet import *
12 changes: 6 additions & 6 deletions tests/ExtractArchive/test_ExtractArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def test_ExtractArchive():
os.remove(path / ".BP_Extract_BPL")
if (path / "BP_Extract.bpa").exists():
os.remove(path / "BP_Extract.bpa")
if (path / "../BP_Extract.md5").exists():
os.remove(path / "../BP_Extract.md5")
if (path / "BP_Extract.md5").exists():
os.remove(path / "BP_Extract.md5")

Expand All @@ -46,9 +44,7 @@ def test_ExtractArchive():
# Run bigplanet
print("Running BigPlanet.")
sys.stdout.flush()

######## SOMETHING IS WRONG WITH MD5CHECKSUMS! #######
subprocess.check_output(["bigplanet", "-ignorecorrupt", "bpl.in", "-a"], cwd=path)
subprocess.check_output(["bigplanet", "bpl.in", "-a"], cwd=path)

file = bp.BPLFile(path / "BP_Extract.bpa")

Expand All @@ -59,9 +55,13 @@ def test_ExtractArchive():

assert np.isclose(earth_Instellation_final[0], 1367.635318)
assert np.isclose(earth_Instellation_final[1], 341.90883)

assert np.isclose(sun_RotPer_initial[0], 86400.0)

shutil.rmtree(path / "BP_Extract")
os.remove(path / ".BP_Extract")
os.remove(path / ".BP_Extract_BPL")
os.remove(path / "BP_Extract.bpa")
os.remove(path / "BP_Extract.md5")

if __name__ == "__main__":
test_ExtractArchive()
2 changes: 1 addition & 1 deletion tests/ExtractFilterArchive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from bigplanet.bp_extract import *
from bigplanet.extract import *
from bigplanet import *
8 changes: 6 additions & 2 deletions tests/ExtractFilterArchive/test_ExtractFilterArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def test_ExtractFilterArchive():
os.remove(path / "BP_Extract.bpa")
if (path / "Test.bpf").exists():
os.remove(path / "Test.bpf")
if (path / "../BP_Extract.md5").exists():
os.remove(path / "../BP_Extract.md5")
if (path / "BP_Extract.md5").exists():
os.remove(path / "BP_Extract.md5")

Expand Down Expand Up @@ -73,6 +71,12 @@ def test_ExtractFilterArchive():
assert np.isclose(vpl_stoptime_option[0], 4.5e9)
assert np.isclose(earth_tman_forward[0][0], 3000.0)

shutil.rmtree(path / "BP_Extract")
os.remove(path / ".BP_Extract")
os.remove(path / ".BP_Extract_BPL")
os.remove(path / "BP_Extract.bpa")
os.remove(path / "Test.bpf")
os.remove(path / "BP_Extract.md5")

if __name__ == "__main__":
test_ExtractFilterArchive()
5 changes: 0 additions & 5 deletions tests/ExtractFilterRaw/.BP_Extract

This file was deleted.

55 changes: 0 additions & 55 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/earth.in

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/sun.in

This file was deleted.

44 changes: 0 additions & 44 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/vpl.in

This file was deleted.

33 changes: 0 additions & 33 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/vplanet_log

This file was deleted.

55 changes: 0 additions & 55 deletions tests/ExtractFilterRaw/BP_Extract/semi_a1/earth.in

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ExtractFilterRaw/BP_Extract/semi_a1/sun.in

This file was deleted.

44 changes: 0 additions & 44 deletions tests/ExtractFilterRaw/BP_Extract/semi_a1/vpl.in

This file was deleted.

33 changes: 0 additions & 33 deletions tests/ExtractFilterRaw/BP_Extract/semi_a1/vplanet_log

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ExtractFilterRaw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from bigplanet.bp_extract import *
from bigplanet.extract import *
from bigplanet import *
Loading

0 comments on commit 9a72101

Please sign in to comment.