-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
passing tests adding update settings
- Loading branch information
1 parent
624cc42
commit 049764c
Showing
8 changed files
with
77 additions
and
45 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
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,24 @@ | ||
from guillotina.commands import Command | ||
from guillotina.component import get_utility | ||
from guillotina.interfaces import ICatalogUtility | ||
|
||
import asyncio | ||
import logging | ||
|
||
|
||
logger = logging.getLogger("guillotina_audit") | ||
|
||
|
||
class UpdateSettingsCommand(Command): | ||
description = "Update Settings Command" | ||
migrator = None | ||
reindexer = None | ||
|
||
def get_parser(self): | ||
parser = super(UpdateSettingsCommand, self).get_parser() | ||
return parser | ||
|
||
async def run(self, arguments, settings, app): | ||
search = get_utility(ICatalogUtility) | ||
await asyncio.sleep(1) | ||
await search.update_settings() |
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 |
---|---|---|
@@ -1,19 +1,13 @@ | ||
from guillotina.component import query_utility | ||
from guillotina_audit.interfaces import IAuditUtility | ||
|
||
import asyncio | ||
import json | ||
import pytest | ||
|
||
|
||
pytestmark = pytest.mark.asyncio | ||
|
||
|
||
async def test_mappings(guillotina_es): | ||
response, status = await guillotina_es( | ||
"POST", "/db/guillotina/@addons", data=json.dumps({"id": "audit"}) | ||
) | ||
assert status == 200 | ||
await asyncio.sleep(2) | ||
audit_utility = query_utility(IAuditUtility) | ||
await audit_utility.update_settings() | ||
await audit_utility.update_mappings() |
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