-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding tests for graph class and plot
- Loading branch information
1 parent
c38fe45
commit eca7cab
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |