Skip to content

Commit 2a24da4

Browse files
committed
update tests
1 parent 820b835 commit 2a24da4

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["yifanfeng97 <[email protected]>"]
66
license = "Apache-2.0"
77
readme = "README.md"
88
homepage = "https://deephypergraph.com"
9-
repository = "https://github.com/imoonlab/deephypergraph"
9+
repository = "https://github.com/iMoonLab/DeepHypergraph"
1010

1111
[tool.poetry.dependencies]
1212
python = "^3.8"

tests/structure/test_bigraph.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def test_save(g1):
2424
from pathlib import Path
2525

2626
save_path = Path("./tmp/test_save.dhg")
27+
if not save_path.parent.exists():
28+
save_path.parent.mkdir()
2729
g1.save(save_path)
2830
g2 = load_structure(save_path)
2931

tests/structure/test_digraph.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def test_save(g1):
2626
from pathlib import Path
2727

2828
save_path = Path("./tmp/test_save.dhg")
29+
if not save_path.parent.exists():
30+
save_path.parent.mkdir()
2931
g1.save(save_path)
3032
g2 = load_structure(save_path)
3133

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
import numpy as np
3+
from pathlib import Path
34

45
import dhg.visualization as vis
56

@@ -10,14 +11,20 @@ def emb1():
1011

1112

1213
def test_draw_in_euclidean_space(emb1):
14+
tmp_path = Path("tmp/")
15+
if not tmp_path.exists():
16+
tmp_path.mkdir()
1317
fig = vis.draw_in_euclidean_space(emb1)
14-
fig.savefig("tmp/test_draw_in_euclidean_space.png")
18+
fig.savefig(tmp_path / "test_draw_in_euclidean_space.png")
1519
fig = vis.draw_in_euclidean_space(emb1, dim=3)
16-
fig.savefig("tmp/test_draw_in_euclidean_space_3d.png")
20+
fig.savefig(tmp_path / "test_draw_in_euclidean_space_3d.png")
1721

1822

1923
def test_draw_poincare_ball(emb1):
24+
tmp_path = Path("tmp/")
25+
if not tmp_path.exists():
26+
tmp_path.mkdir()
2027
fig = vis.draw_in_poincare_ball(emb1)
21-
fig.savefig("tmp/test_draw_poincare_ball.png")
28+
fig.savefig(tmp_path / "test_draw_poincare_ball.png")
2229
fig = vis.draw_in_poincare_ball(emb1, dim=3)
23-
fig.savefig("tmp/test_draw_poincare_ball_3d.png")
30+
fig.savefig(tmp_path / "test_draw_poincare_ball_3d.png")

0 commit comments

Comments
 (0)