-
Notifications
You must be signed in to change notification settings - Fork 3
128 revival complete test coverage #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
9fe1ca4
6d00018
1f48da3
abf12ff
86cabea
ce2bd3c
f449848
7a79d70
f0cafee
ef67111
cdf186e
04a9db5
8ae2c6b
64a8fa6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Tests for legacy functionality.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Tests for legacy search functionality.""" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1 +1,7 @@ | ||||||||||||||||||||||||||||||||||||
| """Tests for the monggregate package.""" | ||||||||||||||||||||||||||||||||||||
| """Tests for `monggregate` package.""" | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| from monggregate.base import BaseModel, Expression, Singleton, express, isbasemodel | ||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||||||||||||||||||||||||||||||||
| from monggregate.dollar import (AggregationVariableEnum,Dollar,DollarDollar,CLUSTER_TIME,NOW,ROOT,CURRENT,REMOVE,DESCEND,PRUNE,KEEP,CONSTANTS,S,SS,) | ||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||||||||||||||||||||||||||||||||
| from monggregate.fields import FieldName, FieldPath, Variable | ||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||||||||||||||||||||||||||||||||
| from monggregate.pipeline import Pipeline, Match, Project | ||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||||||||||||||||||||||||||||||||
| from monggregate.utils import (to_unique_list,validate_field_path,validate_field_paths,StrEnum,) | ||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||
| """Tests for `monggregate.operators` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.operator import Operator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.operator`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||
| """Tests for `monggregate.operators.accumulators` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.accumulators.accumulator import Accumulator, AccumulatorEnum | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.avg import Average, avg | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.count import Count, count | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.first import First, first | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.last import Last, last | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.max import Max, max | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.min import Min, min | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.push import Push, push | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.accumulators.sum import Sum, sum | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||
| """Tests for `monggregate.operators.arithmetic` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.arithmetic.add import Add | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.arithmetic.arithmetic import ArithmeticOperatorEnum | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.arithmetic.divide import Divide | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.arithmetic.multiply import Multiply | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.arithmetic.pow import Pow | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.arithmetic.subtract import Subtract | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.arithmetic.arithmetic`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||
| """Tests for `monggregate.operators.array` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.array.array_to_object import ArrayToObject | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.array import Operator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.filter import Filter | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.first import First | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.in_ import In | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.is_array import IsArray | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.last import Last | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.max_n import MaxN | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.min_n import MinN | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.size import Size | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.array.sort_array import SortArray | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.array.array`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| """Tests for `monggregate.operators.boolean` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.boolean.and_ import And | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.boolean.boolean import BooleanOperator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.boolean.not_ import Not | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.boolean.or_ import Or | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| """Tests for `monggregate.operators.boolean.boolean`.""" | ||
|
|
||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||
| """Tests for `monggregate.operators.comparison` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.comparison.cmp import Compare | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.comparison.comparator import Comparator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.comparison.eq import Equal | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.comparison.gt import GreatherThan | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.comparison.gte import GreatherThanOrEqual | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.comparison.lt import LowerThan | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.comparison.lte import LowerThanOrEqual | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.comparison.ne import NotEqual | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.comparison`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,8 +2,6 @@ | |||||||
|
|
||||||||
| from monggregate.operators.comparison.gte import GreatherThanOrEqual | ||||||||
|
|
||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||
| from monggregate.operators.comparison.gte import GreatherThanOrEqual | ||||||||
|
|
||||||||
| def test_greather_than_or_equal_expression(): | ||||||||
| # Setup | ||||||||
| left = "$field" | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,8 +2,6 @@ | |||||||
|
|
||||||||
| from monggregate.operators.comparison.lt import LowerThan | ||||||||
|
|
||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||
| from monggregate.operators.comparison.lt import LowerThan | ||||||||
|
|
||||||||
| def test_lower_than_expression(): | ||||||||
| # Setup | ||||||||
| left = "$field" | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| """Tests for `monggregate.operators.conditional` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.conditional.cond import Cond | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.conditional.conditional import ConditionalOperator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.conditional.if_null import IfNull | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.conditional.switch import Switch | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.conditional.conditional`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| """Tests for `monggregate.operators.custom.custom`.""" | ||
|
|
||
| from monggregate.operators.custom.custom import CustomOperator | ||
| # TODO |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.custom.custom`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||
| """Tests for `monggregate.operators.data_size`.""" | ||||||
|
|
||||||
| from monggregate.operators.data_size.data_size import DataSizeOperator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.data_size.data_size`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||
| """Tests for `monggregate.operators.date` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.date.date import DateOperator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.date.millisecond import Millisecond | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.date.date`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| """Tests for `monggregate.operators.objects` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.objects.merge_objects import MergeObjects | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.objects.object_ import ObjectOperator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.objects.object_to_array import ObjectToArray | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| """Tests for `monggregate.operators.objects.objects`.""" | ||
|
|
||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| """Tests for `monggregate.operators.strings` subpackage.""" | ||||||
|
|
||||||
| from monggregate.operators.strings.concat import Concat | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.strings.date_from_string import DateFromString | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.strings.date_to_string import DateToString | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Ruff] reported by reviewdog 🐶 |
||||||
| from monggregate.operators.strings.string import StringOperator | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Tests for `monggregate.operators.strings.string`.""" | ||
|
|
||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||
| """Test for 'monggregate.operators.type_.type_'""" | ||||||
|
|
||||||
| from monggregate.operators.type_.type_ import Type_ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1 @@ | ||||||
| """Tests for `monggregate.search.collectors`""" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # TODO |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # TODO |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # TODO |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # TODO |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,13 @@ | ||||||
| """Tests for `monggregate.search.operators` subpackage.""" | ||||||
|
|
||||||
| from monggregate.search.operators.autocomplete import Autocomplete | ||||||
| from monggregate.search.operators.clause import Clause | ||||||
| from monggregate.search.operators.compound import Compound | ||||||
| from monggregate.search.operators.equals import Equals | ||||||
| from monggregate.search.operators.exists import Exists | ||||||
| from monggregate.search.operators.more_like_this import MoreLikeThis | ||||||
| from monggregate.search.operators.operator import SearchOperator | ||||||
| from monggregate.search.operators.range import Range | ||||||
| from monggregate.search.operators.regex import Regex | ||||||
| from monggregate.search.operators.text import Text | ||||||
| from monggregate.search.operators.wildcard import Wildcard | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||||||||||||||||
| import pytest | ||||||||||||||||||
| from monggregate.search.operators.autocomplete import Autocomplete | ||||||||||||||||||
| from monggregate.search.commons import FuzzyOptions | ||||||||||||||||||
|
|
||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||
| def test_autocomplete_expression(): | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [mypy] reported by reviewdog 🐶 |
||||||||||||||||||
| # Setup | ||||||||||||||||||
| query = "test" | ||||||||||||||||||
| path = "field" | ||||||||||||||||||
| fuzzy_options = FuzzyOptions(maxEdits=1, prefixLength=1, maxExpansions=10) | ||||||||||||||||||
|
|
||||||||||||||||||
| autocomplete = Autocomplete( | ||||||||||||||||||
| query=query, | ||||||||||||||||||
| path=path, | ||||||||||||||||||
| token_order="any", | ||||||||||||||||||
| fuzzy=fuzzy_options, | ||||||||||||||||||
| score={"boost": 2} | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| expected_expression = { | ||||||||||||||||||
| "autocomplete": { | ||||||||||||||||||
| "query": query, | ||||||||||||||||||
| "path": path, | ||||||||||||||||||
| "tokenOrder": "any", | ||||||||||||||||||
| "fuzzy": { | ||||||||||||||||||
| "maxEdits": 1, | ||||||||||||||||||
| "prefixLength": 1, | ||||||||||||||||||
| "maxExpansions": 10 | ||||||||||||||||||
| }, | ||||||||||||||||||
| "score": {"boost": 2} | ||||||||||||||||||
|
Comment on lines
+24
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| # Act | ||||||||||||||||||
| actual_expression = autocomplete.expression | ||||||||||||||||||
|
|
||||||||||||||||||
| # Assert | ||||||||||||||||||
| assert actual_expression == expected_expression | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| import pytest | ||
| from monggregate.search.operators.autocomplete import Autocomplete | ||
| from monggregate.search.operators.equals import Equals | ||
| from monggregate.search.operators.exists import Exists | ||
| from monggregate.search.operators.more_like_this import MoreLikeThis | ||
| from monggregate.search.operators.range import Range | ||
| from monggregate.search.operators.regex import Regex | ||
| from monggregate.search.operators.text import Text | ||
| from monggregate.search.operators.wildcard import Wildcard | ||
|
|
||
| class TestSearchOperators: | ||
| """Tests unitaires pour tous les opérateurs de recherche de monggregate.""" | ||
|
|
||
| def test_autocomplete(self): | ||
| """Teste la génération de l'expression autocomplete.""" | ||
| # Corrected: query should likely be a list | ||
| autocomplete = Autocomplete(query=["test"], path="field") | ||
| expected = { | ||
| "autocomplete": { | ||
| "query": ["test"], # Corrected: query should be a list in expected | ||
| "path": "field" | ||
| } | ||
| } | ||
| assert autocomplete.expression == expected | ||
|
|
||
| def test_equals(self): | ||
| """Teste la génération de l'expression equals.""" | ||
| equals = Equals(value=42, path="field") | ||
| expected = { | ||
| "equals": { | ||
| "value": 42, | ||
| "path": "field" | ||
| } | ||
| } | ||
| assert equals.expression == expected | ||
|
|
||
| def test_exists(self): | ||
| """Teste la génération de l'expression exists.""" | ||
| exists = Exists(path="field") | ||
| expected = { | ||
| "exists": { | ||
| "path": "field" | ||
| } | ||
| } | ||
| assert exists.expression == expected | ||
|
|
||
| def test_more_like_this(self): | ||
| """Teste la génération de l'expression moreLikeThis.""" | ||
| # Corrected: 'like' should likely be a list | ||
| more_like_this = MoreLikeThis( | ||
| like=["test"], # Corrected: 'like' should be a list | ||
| path="field", | ||
| minTermFreq=1, | ||
| minDocFreq=1 | ||
| ) | ||
| expected = { | ||
| "moreLikeThis": { | ||
| "like": ["test"], # Corrected: 'like' should be a list in expected | ||
| "path": "field", | ||
| "minTermFreq": 1, | ||
| "minDocFreq": 1 | ||
| } | ||
| } | ||
| assert more_like_this.expression == expected | ||
|
|
||
| def test_range(self): | ||
| """Teste la génération de l'expression range.""" | ||
| # Corrected: path should likely be a list | ||
| range_op = Range(path=["field"], gt=10, lt=20) # Corrected: path should be a list | ||
| expected = { | ||
| "range": { | ||
| "path": ["field"], # Corrected: path should be a list in expected | ||
| "gt": 10, | ||
| "lt": 20 | ||
| } | ||
| } | ||
| assert range_op.expression == expected | ||
|
|
||
| def test_regex(self): | ||
| """Teste la génération de l'expression regex.""" | ||
| # Corrected: path should likely be a list | ||
| # allowAnalyzedField should be included in the expected dict as it's explicitly set. | ||
| regex = Regex(pattern="^test", path=["field"], allowAnalyzedField=False) # Corrected: path should be a list | ||
| expected = { | ||
| "regex": { | ||
| "pattern": "^test", | ||
| "path": ["field"], # Corrected: path should be a list in expected | ||
| "allowAnalyzedField": False | ||
| } | ||
| } | ||
| assert regex.expression == expected | ||
|
|
||
| def test_text(self): | ||
| """Teste la génération de l'expression text.""" | ||
| # Corrected: query should likely be a list | ||
| text = Text(query=["test"], path="field") # Corrected: query should be a list | ||
| expected = { | ||
| "text": { | ||
| "query": ["test"], # Corrected: query should be a list in expected | ||
| "path": "field" | ||
| } | ||
| } | ||
| assert text.expression == expected | ||
|
|
||
| def test_wildcard(self): | ||
| """Teste la génération de l'expression wildcard.""" | ||
| # The wildcard operator also has `allowAnalyzedField` which defaults to `False`. | ||
| # If it's not explicitly passed to the constructor and the default is False, | ||
| # it might not appear in the expression. However, if the expected output | ||
| # always includes it, we keep it. If the problem persists, try removing it. | ||
| wildcard = Wildcard(query=["test"], path="field") # Corrected: query should be a list | ||
| expected = { | ||
| "wildcard": { | ||
| "query": ["test"], # Corrected: query should be a list in expected | ||
| "path": "field", | ||
| "allowAnalyzedField": False # Keeping this as it's a default, if it fails, remove it. | ||
| } | ||
| } | ||
| assert wildcard.expression == expected | ||
|
|
||
|
|
||
| # TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Ruff] reported by reviewdog 🐶
F401
monggregate.base.BaseModelimported but unused; consider removing, adding to__all__, or using a redundant alias