Skip to content

Commit

Permalink
Merge pull request #32 from LEv145:dev
Browse files Browse the repository at this point in the history
V0.4.2
  • Loading branch information
LEv145 authored Dec 14, 2021
2 parents bdf643e + c2345bf commit 00a8016
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion sporepedia/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ async def cli() -> None:
"text",
type=str,
)
@click.option(
"-L", "--lenght",
type=int
)
@click.option(
"-Fu", "--functions",
type=BoolDataclassType(FunctionsSearchParam),
Expand All @@ -109,6 +113,7 @@ async def cli() -> None:
)
async def search(
text: str,
lenght: int,
functions: Optional[FunctionsSearchParam],
fields: Optional[FieldsSearchParam],
models: Optional[ModelsSearchParam],
Expand All @@ -117,7 +122,8 @@ async def search(
) -> None:
async with _client as client:
result = await client.search(
text,
text=text,
lenght=lenght,
params=SearchParams(
functions=functions,
fields=fields,
Expand Down
9 changes: 7 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ async def test__search(self):
(
"search",
"test",
"-Fu", "IS_CREATURE, is_civ_creature",
"--lenght", "10",
"-Fu", "is_creature,is_tribe_creature,is_civ_creature,\
is_space_creature,is_adventure_creature,is_city_hall,is_house,\
is_industry,is_entertainment,is_ufo,is_adv_attack,is_adv_collect,\
is_adv_defend,is_adv_explore,is_adv_unset,is_adv_puzzle,is_adv_quest,\
is_adv_socialize,is_adv_story,is_adv_template,",
"-F", "most_popular_new",
"--fields", "is_author,is_description",
"--fields", "is_name,is_author,is_tag,is_description",
"-P", "is_colony",
)
)
Expand Down

0 comments on commit 00a8016

Please sign in to comment.