Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Element.__contains__ method (#2330)
- Loading branch information
1 parent
d05358f
commit 98b2d62
Showing
4 changed files
with
44 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from holoviews.core import Dimension, Element | ||
from holoviews.element.comparison import ComparisonTestCase | ||
|
||
|
||
class ElementTests(ComparisonTestCase): | ||
|
||
def setUp(self): | ||
self.element = Element([], kdims=['A', 'B'], vdims=['C']) | ||
|
||
def test_key_dimension_in_element(self): | ||
self.assertTrue(Dimension('A') in self.element) | ||
|
||
def test_value_dimension_in_element(self): | ||
self.assertTrue(Dimension('C') in self.element) | ||
|
||
def test_dimension_not_in_element(self): | ||
self.assertFalse(Dimension('D') in self.element) | ||
|
||
def test_key_dimension_string_in_element(self): | ||
self.assertTrue('A' in self.element) | ||
|
||
def test_value_dimension_string_in_element(self): | ||
self.assertTrue('C' in self.element) | ||
|
||
def test_dimension_string_not_in_element(self): | ||
self.assertFalse('D' in self.element) |