-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't include facts with geometry issues (#306)
- Loading branch information
1 parent
6c2ed36
commit cdc48cb
Showing
3 changed files
with
89 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
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,61 @@ | ||
#!/usr/bin/env -S pytest -svv | ||
from copy import deepcopy | ||
|
||
from digital_land.phase.pivot import PivotPhase | ||
|
||
|
||
def test_pivot(): | ||
input = [ | ||
{ | ||
"priority": 1, | ||
"entity": 1234, | ||
"resource": "res0123", | ||
"line-number": 1, | ||
"entry-number": 1, | ||
"row": { | ||
"entry-date": "2024-12-04", | ||
"test-field": "test-value", | ||
}, | ||
} | ||
] | ||
|
||
output = [deepcopy(block) for block in PivotPhase().process(input)] | ||
|
||
assert output == [ | ||
{ | ||
"entity": 1234, | ||
"entry-number": 1, | ||
"line-number": 1, | ||
"priority": 1, | ||
"resource": "res0123", | ||
"row": { | ||
"entity": "", | ||
"entry-date": "2024-12-04", | ||
"entry-number": 1, | ||
"fact": "", | ||
"field": "entry-date", | ||
"line-number": 1, | ||
"priority": 1, | ||
"resource": "res0123", | ||
"value": "2024-12-04", | ||
}, | ||
}, | ||
{ | ||
"entity": 1234, | ||
"entry-number": 1, | ||
"line-number": 1, | ||
"priority": 1, | ||
"resource": "res0123", | ||
"row": { | ||
"entity": "", | ||
"entry-date": "2024-12-04", | ||
"entry-number": 1, | ||
"fact": "", | ||
"field": "test-field", | ||
"line-number": 1, | ||
"priority": 1, | ||
"resource": "res0123", | ||
"value": "test-value", | ||
}, | ||
}, | ||
] |