def METHOD_NAME(fig1, pretty, remove_uids):
    # Configure file-like mock
    filemock = MagicMock()
    del filemock.write_text
    # write_json to mock file
    pio.write_json(fig1, filemock, pretty=pretty, remove_uids=remove_uids)
    # check write contents
    expected = pio.to_json(fig1, pretty=pretty, remove_uids=remove_uids)
    filemock.write.assert_called_once_with(expected)