Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions python/ee/tests/filter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@ def test_constructors(self):
copy = ee.Filter(from_static_method)
self.assertEqual(from_static_method, copy)

def test_constructor_no_args(self):
# This is code to be avoided, but since it has been this way for a long
# time, this captures the current behavior.
# Please do not use `ee.Filter()` to access static methods like `Or`.
# Instead, call them directly on the class, e.g., `ee.Filter.Or(...)`.
a_filter = ee.Filter()
self.assertEqual(a_filter.predicateCount(), 0)

self.assertTrue(a_filter.isVariable())

# Not very intuitive error message.
with self.assertRaisesRegex(ee.EEException, 'arguments cannot be used'):
a_filter.serialize()

# Not very intuitive error message.
with self.assertRaisesRegex(ee.EEException, 'arguments cannot be used'):
str(a_filter)

def test_metadata(self):
"""Verifies that the metadata_() method works."""
self.assertEqual(
Expand Down
Loading