예제 #1
0
 def test_parse_and_serialize(self):
     inputs = [
         '{"username": "******", "password": "******"}',
         '{"password": "******", "username": "******"}',
     ]
     for json_input in inputs:
         _dict = parameters.DictParameter()._p.parse_from_str(json_input)
         assert json.loads(json_input) == _dict
예제 #2
0
 def test_parse_invalid_input(self):
     with pytest.raises(ValueError):
         parameters.DictParameter()._p.parse_from_str('{"invalid"}')
예제 #3
0
 def test_parse(self):
     d = parameters.DictParameter()._p.parse_from_str(
         json.dumps(TestDictParameter._dict))
     assert d == TestDictParameter._dict
예제 #4
0
class DictParameterTask(TTask):
    param = parameters.DictParameter()