<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>httpretty.errors — HTTPretty 0.9.6 documentation</title> <script type="text/javascript" src="../../_static/js/modernizr.min.js"></script> <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script> <script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script> <script type="text/javascript" src="../../_static/language_data.js"></script> <script type="text/javascript" src="../../_static/js/theme.js"></script> <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="index" title="Index" href="../../genindex.html" /> <link rel="search" title="Search" href="../../search.html" /> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > <a href="../../index.html" class="icon icon-home"> HTTPretty </a> <div class="version"> 0.9.6 </div> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <ul> <li class="toctree-l1"><a class="reference internal" href="../../introduction.html">What is HTTPretty ?</a></li> <li class="toctree-l1"><a class="reference internal" href="../../introduction.html#demo">Demo</a></li> <li class="toctree-l1"><a class="reference internal" href="../../introduction.html#motivation">Motivation</a></li> <li class="toctree-l1"><a class="reference internal" href="../../acks.html">Acknowledgements</a></li> <li class="toctree-l1"><a class="reference internal" href="../../api.html">API Reference</a></li> <li class="toctree-l1"><a class="reference internal" href="../../api.html#modules">Modules</a></li> <li class="toctree-l1"><a class="reference internal" href="../../contributing.html">Hacking on HTTPretty</a></li> <li class="toctree-l1"><a class="reference internal" href="../../contributing.html#license">License</a></li> <li class="toctree-l1"><a class="reference internal" href="../../contributing.html#main-contributors">Main contributors</a></li> <li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Release Notes</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../index.html">HTTPretty</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../../index.html">Docs</a> »</li> <li><a href="../index.html">Module code</a> »</li> <li><a href="../httpretty.html">httpretty</a> »</li> <li>httpretty.errors</li> <li class="wy-breadcrumbs-aside"> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <h1>Source code for httpretty.errors</h1><div class="highlight"><pre> <span></span><span class="c1"># #!/usr/bin/env python</span> <span class="c1"># -*- coding: utf-8 -*-</span> <span class="c1">#</span> <span class="c1"># <HTTPretty - HTTP client mock for Python></span> <span class="c1"># Copyright (C) <2011-2018> Gabriel Falcao <gabriel@nacaolivre.org></span> <span class="c1">#</span> <span class="c1"># Permission is hereby granted, free of charge, to any person</span> <span class="c1"># obtaining a copy of this software and associated documentation</span> <span class="c1"># files (the "Software"), to deal in the Software without</span> <span class="c1"># restriction, including without limitation the rights to use,</span> <span class="c1"># copy, modify, merge, publish, distribute, sublicense, and/or sell</span> <span class="c1"># copies of the Software, and to permit persons to whom the</span> <span class="c1"># Software is furnished to do so, subject to the following</span> <span class="c1"># conditions:</span> <span class="c1">#</span> <span class="c1"># The above copyright notice and this permission notice shall be</span> <span class="c1"># included in all copies or substantial portions of the Software.</span> <span class="c1">#</span> <span class="c1"># THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</span> <span class="c1"># EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES</span> <span class="c1"># OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span> <span class="c1"># NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</span> <span class="c1"># HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,</span> <span class="c1"># WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span> <span class="c1"># FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR</span> <span class="c1"># OTHER DEALINGS IN THE SOFTWARE.</span> <span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">unicode_literals</span> <div class="viewcode-block" id="HTTPrettyError"><a class="viewcode-back" href="../../api.html#httpretty.errors.HTTPrettyError">[docs]</a><span class="k">class</span> <span class="nc">HTTPrettyError</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span> <span class="k">pass</span></div> <div class="viewcode-block" id="UnmockedError"><a class="viewcode-back" href="../../api.html#httpretty.errors.UnmockedError">[docs]</a><span class="k">class</span> <span class="nc">UnmockedError</span><span class="p">(</span><span class="n">HTTPrettyError</span><span class="p">):</span> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="nb">super</span><span class="p">(</span><span class="n">UnmockedError</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span> <span class="s1">'No mocking was registered, and real connections are '</span> <span class="s1">'not allowed (httpretty.allow_net_connect = False).'</span> <span class="p">)</span></div> </pre></div> </div> </div> <footer> <hr/> <div role="contentinfo"> <p> © Copyright 2018, Gabriel Falcao </p> </div> Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>