-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from Carifio24/unique-class
Add unique class to each viewer instance
- Loading branch information
Showing
5 changed files
with
37 additions
and
2 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 @@ | ||
from .base_viewer_tests import BasePlotlyViewTests # noqa |
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,22 @@ | ||
from uuid import UUID | ||
|
||
|
||
class BasePlotlyViewTests: | ||
|
||
def setup_method(self, method): | ||
pass | ||
|
||
def teardown_method(self, method): | ||
pass | ||
|
||
def test_unique_class(self): | ||
unique_class = self.viewer.unique_class | ||
prefix = "glue-plotly-" | ||
prefix_len = len(prefix) | ||
assert unique_class.startswith(prefix) | ||
assert len(unique_class) == prefix_len + 32 | ||
|
||
# Test UUID validity by seeing if we can construct a UUID instance | ||
assert UUID(unique_class[prefix_len:]) | ||
|
||
assert unique_class in self.viewer.figure._dom_classes |
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
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
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