def test_create_interchain_ethereum(self, mock_get_output, mock_exist,
                                     mock_save_client, mock_new_from_user):
     self.assertEqual(
         interchain.create_ethereum_interchain_v1({"thing": "ok"}), "blah")
     mock_new_from_user.assert_called_once_with({"thing": "ok"})
     mock_save_client.assert_called_once_with(
         mock_new_from_user.return_value)
     mock_get_output.assert_called_once_with(
         mock_new_from_user.return_value)
示例#2
0
def create_ethereum_interchain_v1(**kwargs) -> Tuple[str, int, Dict[str, str]]:
    if not flask.request.is_json:
        raise exceptions.BadRequest("Could not parse JSON")
    data = flask.request.json
    try:
        _validate_ethereum_network_create_v1(data)
    except fastjsonschema.JsonSchemaException as e:
        raise exceptions.ValidationException(str(e))

    return helpers.flask_http_response(
        201, interchain.create_ethereum_interchain_v1(data))