-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from salute-developers/fix/as_is_to_message
Fix/as is to message
- Loading branch information
Showing
8 changed files
with
67 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# coding: utf-8 | ||
import json | ||
import unittest | ||
from unittest.mock import Mock | ||
|
||
from smart_kit.message.as_is_to_message import AsIsToMessage | ||
|
||
|
||
class TestAsIsTooMessage(unittest.TestCase): | ||
def setUp(self): | ||
self.command_ = Mock() | ||
self.request_ = Mock() | ||
self.message_ = Mock() | ||
self.command_.loader = "json.dumps" | ||
self.request_.header = "json" | ||
self.command_.payload = {} | ||
self.command_.root_nodes = {} | ||
self.command_.raw = { | ||
"content": {"test_param": ""}, | ||
"surface": "some_surface", | ||
"project_id": "project_id", | ||
} | ||
self.message_.sub = 'sub' | ||
|
||
def test_as_is_to_message_as_dict(self): | ||
obj = AsIsToMessage(self.command_, self.message_, self.request_) | ||
self.assertEqual(obj.as_dict, { | ||
"content": {"test_param": ""}, | ||
"surface": "some_surface", | ||
"project_id": "project_id"}) |
Oops, something went wrong.