Initial DumasNodes seed
This commit is contained in:
23
tests/test_dumas_json_nodes.py
Normal file
23
tests/test_dumas_json_nodes.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import unittest
|
||||
|
||||
from dumas_json_nodes import DumasJSONStringToObjectNode
|
||||
|
||||
|
||||
class DumasJSONStringToObjectNodeTests(unittest.TestCase):
|
||||
def test_parses_valid_json(self):
|
||||
node = DumasJSONStringToObjectNode()
|
||||
|
||||
result = node.convert_string_to_json('{"name":"Dumas","count":2}')
|
||||
|
||||
self.assertEqual(result, ({"name": "Dumas", "count": 2},))
|
||||
|
||||
def test_returns_none_for_invalid_json(self):
|
||||
node = DumasJSONStringToObjectNode()
|
||||
|
||||
result = node.convert_string_to_json('{"name":')
|
||||
|
||||
self.assertEqual(result, (None,))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user