|
| 1 | +from httmock import urlmatch |
| 2 | + |
| 3 | + |
| 4 | +free_proxy_expected = ['http://138.197.136.46:3128', 'http://177.207.75.227:8080'] |
| 5 | +proxy_for_eu_expected = ['http://107.151.136.222:80', 'http://37.187.253.39:8115'] |
| 6 | +rebro_weebly_expected = ['http://213.149.105.12:8080', 'http://119.188.46.42:8080'] |
| 7 | +samair_expected = ['http://191.252.61.28:80', 'http://167.114.203.141:8080'] |
| 8 | + |
| 9 | +@urlmatch(netloc=r'(.*\.)?free-proxy-list\.net$') |
| 10 | +def free_proxy_mock(url, request): |
| 11 | + return """<table border="0" cellpadding="0" cellspacing="0" class="display fpltable" |
| 12 | +id="proxylisttable">\n |
| 13 | +<thead>\n |
| 14 | +<tr>\n |
| 15 | + <th>IP Address</th> |
| 16 | + \n |
| 17 | + <th>Port</th> |
| 18 | + \n |
| 19 | + <th>Code</th> |
| 20 | + \n |
| 21 | + <th>Country</th> |
| 22 | + \n |
| 23 | + <th>Anonymity</th> |
| 24 | + \n |
| 25 | + <th>Google</th> |
| 26 | + \n |
| 27 | + <th>Https</th> |
| 28 | + \n |
| 29 | + <th>Last Checked</th> |
| 30 | + \n |
| 31 | +</tr> |
| 32 | +\n |
| 33 | +</thead> |
| 34 | +\n |
| 35 | +<tbody> |
| 36 | +<tr> |
| 37 | + <td>138.197.136.46</td> |
| 38 | + <td>3128</td> |
| 39 | + <td>CA</td> |
| 40 | + <td>Canada</td> |
| 41 | + <td>anonymous</td> |
| 42 | + <td>no</td> |
| 43 | + <td>no</td> |
| 44 | + <td>7 seconds ago</td> |
| 45 | +</tr> |
| 46 | +\n |
| 47 | +<tr> |
| 48 | + <td>177.207.75.227</td> |
| 49 | + <td>8080</td> |
| 50 | + <td>BR</td> |
| 51 | + <td>Brazil</td> |
| 52 | + <td>transparent</td> |
| 53 | + <td>no</td> |
| 54 | + <td>no</td> |
| 55 | + <td>2 hours 21 minutes ago</td> |
| 56 | +</tr> |
| 57 | +\n |
| 58 | +</tbody> |
| 59 | +\n |
| 60 | +<tfoot>\n |
| 61 | +<tr>\n |
| 62 | + <th class="input"><input type="text"/></th> |
| 63 | + \n |
| 64 | + <th></th> |
| 65 | + \n |
| 66 | + <th></th> |
| 67 | + \n |
| 68 | + <th></th> |
| 69 | + \n |
| 70 | + <th></th> |
| 71 | + \n |
| 72 | + <th></th> |
| 73 | + \n |
| 74 | + <th></th> |
| 75 | + \n |
| 76 | + <th></th> |
| 77 | + \n |
| 78 | +</tr> |
| 79 | +\n |
| 80 | +</tfoot> |
| 81 | +\n |
| 82 | +</table>""" |
| 83 | + |
| 84 | + |
| 85 | +@urlmatch(netloc=r'(.*\.)?proxyfor\.eu') |
| 86 | +def proxy_for_eu_mock(url, request): |
| 87 | + return """<table class="proxy_list"> |
| 88 | + <tr> |
| 89 | + <th>IP</th> |
| 90 | + <th>Port</th> |
| 91 | + <th>Country</th> |
| 92 | + <th>Anon</th> |
| 93 | + <th>Speed</th> |
| 94 | + <th> Check</th> |
| 95 | + <th>Cookie/POST</th> |
| 96 | + </tr> |
| 97 | + <tr> |
| 98 | + <td>107.151.136.222</td> |
| 99 | + <td>80</td> |
| 100 | + <td>United States</td> |
| 101 | + <td>HIGH</td> |
| 102 | + <td>1.643</td> |
| 103 | + <td>2016-04-12 17:02:43</td> |
| 104 | + <td>Yes/Yes</td> |
| 105 | + </tr> |
| 106 | + <tr> |
| 107 | + <td>37.187.253.39</td> |
| 108 | + <td>8115</td> |
| 109 | + <td>France</td> |
| 110 | + <td>HIGH</td> |
| 111 | + <td>12.779</td> |
| 112 | + <td>2016-04-12 14:36:18</td> |
| 113 | + <td>Yes/Yes</td> |
| 114 | + </tr> |
| 115 | +</table>""" |
| 116 | + |
| 117 | + |
| 118 | +@urlmatch(netloc=r'(.*\.)?rebro\.weebly\.com$') |
| 119 | +def rebro_weebly_mock(url, request): |
| 120 | + return """<div class="paragraph" style="text-align:left;"><strong><font color="#3ab890" |
| 121 | + size="3"><font |
| 122 | + color="#d5d5d5">IP:Port</font></font></strong><br/><font |
| 123 | + size="2"><strong><font color="#33a27f">213.149.105.12:8080<br/>119.188.46.42:8080</font></strong></font><br/><span></span> |
| 124 | +</div>""" |
| 125 | + |
| 126 | + |
| 127 | +@urlmatch(netloc=r'(.*\.)?www.samair.ru') |
| 128 | +def samair_mock(url, request): |
| 129 | + return """<table id="proxylist">\n |
| 130 | + <tr class="list_sorted">\n |
| 131 | + <th><a href="http://samair.ru/proxy/ip-address-01.htm" |
| 132 | + title="Proxy List sorted by ip address">IP address</a></th> |
| 133 | + \n |
| 134 | + <th><a href="http://samair.ru/proxy/proxy-01.htm" |
| 135 | + title="Proxy List sorted by anonymity level">Anonymity level</a> |
| 136 | + </th> |
| 137 | + \n |
| 138 | + <th><a href="http://samair.ru/proxy/time-01.htm" |
| 139 | + title="Proxy List sorted by updated time">Checked time</a></th> |
| 140 | + \n |
| 141 | + <th><a href="http://samair.ru/proxy/type-01.htm" |
| 142 | + title="Proxy list sorted by country">Country</a></th> |
| 143 | + \n |
| 144 | + <th><dfn title="City or State\\Region ">City</dfn></th> |
| 145 | + \n |
| 146 | + <th><dfn title="Internet Service Provider">ISP</dfn></th> |
| 147 | + \n |
| 148 | + </tr> |
| 149 | + \n |
| 150 | + <tr class="elite"> |
| 151 | + <td>191.252.61.28:80</td> |
| 152 | + <td>high-anonymous</td> |
| 153 | + <td>Apr-18, 17:18</td> |
| 154 | + <td>Brazil</td> |
| 155 | + <td>S\xe3o Jos\xe9 Dos Campos</td> |
| 156 | + <td><dfn title="Locaweb Servi\xe7os de Internet S/A">Locaweb |
| 157 | + Servi\xe7o...</dfn></td> |
| 158 | + </tr> |
| 159 | + \n |
| 160 | + <tr class="transp"> |
| 161 | + <td>167.114.203.141:8080</td> |
| 162 | + <td>transparent</td> |
| 163 | + <td>Apr-18, 13:22</td> |
| 164 | + <td>Canada</td> |
| 165 | + <td>Montr\xe9al (QC)</td> |
| 166 | + <td>OVH Hosting</td> |
| 167 | + </tr> |
| 168 | + \n |
| 169 | +</table>""" |
0 commit comments