Skip to content

Commit

Permalink
adding tests for graph class and plot
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Jun 12, 2024
1 parent c38fe45 commit eca7cab
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/artifacts/graph_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Tests for SageWorks Graphs"""

# SageWorks Imports
from sageworks.core.artifacts.graph_core import GraphCore

test_graph = GraphCore("karate-club")


def test_general_info():
"""Simple test of the Endpoint functionality"""

# Call the various methods

# Let's do a check/validation of the Graph
assert test_graph.exists()

# Creation/Modification Times
print(test_graph.created())
print(test_graph.modified())

# Details
print(test_graph.details())

# Get the tags associated with this Graph
print(f"Tags: {test_graph.get_tags()}")


if __name__ == "__main__":

# Run the tests
test_general_info()

print("All tests passed!")
24 changes: 24 additions & 0 deletions tests/web_components/graph_plot_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Tests for graph_plot web component"""

# SageWorks Imports
from sageworks.core.artifacts.graph_core import GraphCore
from sageworks.web_components.plugins.graph_plot import GraphPlot


def test_graph_plot():
"""Test the GraphPlot class"""

# Instantiate a Graph
graph = GraphCore("karate_club")

# Instantiate the GraphPlot class
graph_plot = GraphPlot()

# Generate the figure
[figure] = graph_plot.update_properties(graph)
figure.show()


if __name__ == "__main__":
# Run the tests
test_graph_plot()

0 comments on commit eca7cab

Please sign in to comment.