Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
CalystaT committed Sep 8, 2023
1 parent e746313 commit f8a0c88
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
Binary file modified tests/__pycache__/unit_tests.cpython-311.pyc
Binary file not shown.
52 changes: 27 additions & 25 deletions tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,31 +429,33 @@ def test_plot_planar_cube(self):
self.addCleanup(os.remove, "planar_average.csv")
self.addCleanup(os.remove, "planar_average.png")

@pytest.mark.mpl_image_compare(
baseline_dir=f"{_file_path}/testIm",
filename="BandAlignment.png",
style=f"{_file_path}/../macrodensity/macrodensity.mplstyle",
savefig_kwargs={"transparent": True, "bbox_inches": "tight"},
)
def test_energy_band_alignment_diagram(self):
"""Tests the energy_band_alignment_diagram function"""

fig = md.energy_band_alignment_diagram(
{
"ZnO": [4.4, 7.7],
"MOF-5": [2.7, 7.3],
"HKUST-1": [5.1, 6.0],
"ZIF-8": [0.9, 6.4],
"COF-1M": [1.3, 4.7],
"CPO-27-Mg": [2.9, 5.9],
"MIL-125": [3.8, 7.6],
"TiO2": [4.8, 7.8],
},
ylims=(-10, 0.0),
arrowhead=0.15,
)
self.addCleanup(os.remove, "BandAlignment.pdf")
return fig
#@pytest.mark.mpl_image_compare(
#baseline_dir=f"{_file_path}/testIm",
#filename="BandAlignment.png",
#style=f"{_file_path}/../macrodensity/macrodensity.mplstyle",
#savefig_kwargs={"transparent": True, "bbox_inches": "tight"},
# )
#def test_energy_band_alignment_diagram(self):
#"""Tests the energy_band_alignment_diagram function"""

#fig = md.energy_band_alignment_diagram(
#{
# "ZnO": [4.4, 7.7],
# "MOF-5": [2.7, 7.3],
# "HKUST-1": [5.1, 6.0],
# "ZIF-8": [0.9, 6.4],
# "COF-1M": [1.3, 4.7],
# "CPO-27-Mg": [2.9, 5.9],
# "MIL-125": [3.8, 7.6],
# "TiO2": [4.8, 7.8],
# },
#ylims=(-10, 0.0),
# arrowhead=0.15,
# fig_format='png'
# )

# self.addCleanup(os.remove, "BandAlignment.png")
# return fig

if __name__ == "__main__":
unittest.main()

0 comments on commit f8a0c88

Please sign in to comment.