-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20d66e2
commit 9dff714
Showing
3 changed files
with
60 additions
and
4 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
34 changes: 34 additions & 0 deletions
34
tests/doc_test/doc_needs_filter_data/module/filter_code_func.py
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,34 @@ | ||
def own_filter_code(needs, results): | ||
for need in needs: | ||
if need["type"] == "test": | ||
results.append(need) | ||
|
||
|
||
def own_filter_code_args(needs, results, **kwargs): | ||
for need in needs: | ||
if need["status"] == kwargs["arg1"]: | ||
results.append(need) | ||
|
||
|
||
def my_pie_filter_code(needs, results): | ||
cnt_x = 0 | ||
cnt_y = 0 | ||
for need in needs: | ||
if need["variant"] == "project_x": | ||
cnt_x += 1 | ||
if need["variant"] == "project_y": | ||
cnt_y += 1 | ||
results.append(cnt_x) | ||
results.append(cnt_y) | ||
|
||
|
||
def my_pie_filter_code_args(needs, results, **kwargs): | ||
cnt_x = 0 | ||
cnt_y = 0 | ||
for need in needs: | ||
if need["status"] == kwargs["arg1"]: | ||
cnt_x += 1 | ||
if need["status"] == kwargs["arg2"]: | ||
cnt_y += 1 | ||
results.append(cnt_x) | ||
results.append(cnt_y) |
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