-
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.
feat: OneClient throws validation error
- Loading branch information
Showing
13 changed files
with
109 additions
and
20 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
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
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,2 +1,2 @@ | ||
from one_sdk.client import OneClient | ||
from one_sdk.error import UnexpectedError, PerformError | ||
from one_sdk.error import UnexpectedError, ValidationError, PerformError |
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,38 @@ | ||
import os | ||
import unittest | ||
|
||
from one_sdk import ValidationError | ||
from one_sdk.app import WasiApp | ||
from one_sdk.platform import PythonFilesystem, PythonNetwork, PythonPersistence | ||
|
||
class TestApp(unittest.TestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
cls.app = WasiApp( | ||
filesystem = PythonFilesystem, | ||
network = PythonNetwork, | ||
persistence = PythonPersistence | ||
) | ||
|
||
with open(os.path.abspath(os.path.join(__file__, "../../src/one_sdk/assets/test-core.wasm")), "rb") as file: | ||
cls.app.load_core(file.read()) | ||
cls.app.init() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
cls.app.destroy() | ||
|
||
def test_invalid_user_input(self): | ||
with self.assertRaises(ValidationError): | ||
self.app.perform( | ||
profile_url = '', | ||
provider_url = '', | ||
map_url = '', | ||
usecase = 'CORE_PERFORM_INPUT_VALIDATION_ERROR', | ||
input = {}, | ||
parameters = {}, | ||
security = {} | ||
) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |