def test_render_error_to_thrift(self): self.assertEqual( types.RenderError( types.I18nMessage("foo", {}), [ types.QuickFix( types.I18nMessage("click"), types.QuickFixAction.PrependStep("filter", {"x": "y"}), ) ], ).to_thrift(), ttypes.RenderError( ttypes.I18nMessage("foo", {}, ttypes.I18nMessageSource()), [ ttypes.QuickFix( ttypes.I18nMessage("click", {}, ttypes.I18nMessageSource()), ttypes.QuickFixAction( prepend_step=ttypes.PrependStepQuickFixAction( "filter", ttypes.RawParams('{"x":"y"}') ) ), ) ], ), )
def test_render_error_to_thrift(self): self.assertEqual( types.arrow_render_error_to_thrift( types.RenderError( I18nMessage("foo", {}, None), [ types.QuickFix( I18nMessage("click", {}, None), types.QuickFixAction.PrependStep( "filter", {"x": "y"}), ) ], )), ttypes.RenderError( ttypes.I18nMessage("foo", {}, None), [ ttypes.QuickFix( ttypes.I18nMessage("click", {}, None), ttypes.QuickFixAction( prepend_step=ttypes.PrependStepQuickFixAction( "filter", {"x": ttypes.Json( string_value="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_from_thrift(self): self.assertEqual( types.thrift_quick_fix_to_arrow( ttypes.QuickFix( ttypes.I18nMessage("click", {}, None), ttypes.QuickFixAction( prepend_step=ttypes.PrependStepQuickFixAction( "filter", {"x": ttypes.Json(string_value="y")})), )), types.QuickFix( I18nMessage("click", {}, None), types.QuickFixAction.PrependStep("filter", {"x": "y"}), ), )