def test_FromJSON(self):
     json_str = '{"name":{"en-US":"test"},\
         "description":{"en-US":"test"},\
         "type":"test",\
         "more_info":"test",\
         "interaction_type":"choice",\
         "correct_responses_pattern": ["test"],\
         "choices": [], "scale": [], "source": [], "target": [], "steps": [],\
         "extensions": {"test": "test"}}'
     adef = ActivityDefinition.from_json(json_str)
     self.definitionVerificationHelper(adef)
Esempio n. 2
0
 def test_FromJSON(self):
     json_str = '{"name":{"en-US":"test"},\
         "description":{"en-US":"test"},\
         "type":"test",\
         "more_info":"test",\
         "interaction_type":"choice",\
         "correct_responses_pattern": ["test"],\
         "choices": [], "scale": [], "source": [], "target": [], "steps": [],\
         "extensions": {"test": "test"}}'
     adef = ActivityDefinition.from_json(json_str)
     self.definitionVerificationHelper(adef)
Esempio n. 3
0
 def test_FromJSONExceptionEmpty(self):
     with self.assertRaises(ValueError):
         ActivityDefinition.from_json('')
Esempio n. 4
0
 def test_FromJSONExceptionPartiallyMalformedJSON(self):
     with self.assertRaises(AttributeError):
         ActivityDefinition.from_json('{"test": "invalid property", "id": \
         "valid property"}')
Esempio n. 5
0
 def test_FromJSONExceptionBadJSON(self):
     with self.assertRaises(ValueError):
         ActivityDefinition.from_json('{"bad JSON"}')
 def test_FromJSONExceptionEmpty(self):
     with self.assertRaises(ValueError):
         ActivityDefinition.from_json("")
 def test_FromJSONExceptionPartiallyMalformedJSON(self):
     with self.assertRaises(AttributeError):
         ActivityDefinition.from_json(
             '{"test": "invalid property", "id": \
         "valid property"}'
         )
 def test_FromJSONExceptionBadJSON(self):
     with self.assertRaises(ValueError):
         ActivityDefinition.from_json('{"bad JSON"}')