-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing of booleanLiterals in cql2-text
- Loading branch information
1 parent
545f002
commit 2a51990
Showing
3 changed files
with
36 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from pygeofilter import ast | ||
from pygeofilter.parsers.cql2_text import parse | ||
|
||
|
||
def test_attribute_eq_true_uppercase(): | ||
result = parse("attr = TRUE") | ||
assert result == ast.Equal( | ||
ast.Attribute("attr"), | ||
True, | ||
) | ||
|
||
def test_attribute_eq_true_lowercase(): | ||
result = parse("attr = true") | ||
assert result == ast.Equal( | ||
ast.Attribute("attr"), | ||
True, | ||
) | ||
|
||
|
||
def test_attribute_eq_false_uppercase(): | ||
result = parse("attr = FALSE") | ||
assert result == ast.Equal( | ||
ast.Attribute("attr"), | ||
False, | ||
) | ||
|
||
|
||
def test_attribute_eq_false_lowercase(): | ||
result = parse("attr = false") | ||
assert result == ast.Equal( | ||
ast.Attribute("attr"), | ||
False, | ||
) |