def test_prepend_step_quick_fix_action_from_thrift(self): self.assertEqual( types.QuickFixAction.from_thrift( ttypes.QuickFixAction( prepend_step=ttypes.PrependStepQuickFixAction( "filter", ttypes.RawParams('{"x":"y"}')))), types.QuickFixAction.PrependStep("filter", {"x": "y"}), )
def test_quick_fix_to_thrift(self): self.assertEqual( types.QuickFix( types.I18nMessage("click"), types.QuickFixAction.PrependStep("filter", {"x": "y"}), ).to_thrift(), ttypes.QuickFix( ttypes.I18nMessage("click", {}), ttypes.QuickFixAction( prepend_step=ttypes.PrependStepQuickFixAction( "filter", ttypes.RawParams('{"x":"y"}'))), ), )
def test_quick_fix_to_thrift(self): self.assertEqual( types.arrow_quick_fix_to_thrift( types.QuickFix( I18nMessage("click", {}, None), types.QuickFixAction.PrependStep("filter", {"x": "y"}), )), ttypes.QuickFix( ttypes.I18nMessage("click", {}, None), ttypes.QuickFixAction( prepend_step=ttypes.PrependStepQuickFixAction( "filter", {"x": ttypes.Json(string_value="y")})), ), )
def test_render_error_from_thrift(self): self.assertEqual( types.thrift_render_error_to_arrow( ttypes.RenderError( ttypes.I18nMessage("foo", {}, None), [ ttypes.QuickFix( ttypes.I18nMessage("click", {}, None), ttypes.QuickFixAction( prepend_step=ttypes.PrependStepQuickFixAction( "filter", ttypes.RawParams('{"x":"y"}'))), ) ], )), types.RenderError( types.I18nMessage("foo", {}), [ types.QuickFix( types.I18nMessage("click"), types.QuickFixAction.PrependStep("filter", {"x": "y"}), ) ], ), )