Skip to content

Commit

Permalink
test: add VCR cassettes for some more annoying online tests
Browse files Browse the repository at this point in the history
Known merge conflict with current master in the `search` plugin (applied
a fix here that's already applied there). Can merge manually to resolve.
  • Loading branch information
dgw committed May 19, 2020
1 parent b0df1f2 commit 5c721e2
Show file tree
Hide file tree
Showing 14 changed files with 733 additions and 9 deletions.
4 changes: 2 additions & 2 deletions sopel/modules/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def exchange(bot, match):
@commands('cur', 'currency', 'exchange')
@example('.cur 100 usd in btc cad eur',
r'100\.0 USD is [\d\.]+ BTC, [\d\.]+ CAD, [\d\.]+ EUR',
re=True)
re=True, online=True)
@example('.cur 100 usd in btc cad eur can aux',
r'100\.0 USD is [\d\.]+ BTC, [\d\.]+ CAD, [\d\.]+ EUR, \(unsupported: CAN, AUX\)',
re=True)
re=True, online=True)
def exchange_cmd(bot, trigger):
if not trigger.group(2):
return bot.reply("No search term. Usage: {}cur 100 usd in btc cad eur"
Expand Down
3 changes: 3 additions & 0 deletions sopel/modules/isup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def isup_insecure(bot, trigger):


@module.commands('isup')
@module.example('.isup google.com',
'http://google.com looks fine to me.',
online=True, vcr=True)
def isup(bot, trigger):
"""Check if a website is up or not."""
handle_isup(bot, trigger, secure=True)
2 changes: 1 addition & 1 deletion sopel/modules/py.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setup(bot):

@module.commands('py')
@module.output_prefix('[py] ')
@module.example('.py len([1,2,3])', '3', online=True)
@module.example('.py len([1,2,3])', '3', online=True, vcr=True)
def py(bot, trigger):
"""Evaluate a Python expression."""
if not trigger.group(2):
Expand Down
6 changes: 4 additions & 2 deletions sopel/modules/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ def duck_api(query):
'.duck site:grandorder.wiki chulainn alter',
r'https?:\/\/grandorder\.wiki\/C%C3%BA_Chulainn.*',
re=True,
online=True)
online=True,
vcr=True)
# the last example (in source line order) is what .help displays
@example(
'.duck sopel.chat irc bot',
r'https?:\/\/(sopel\.chat\/?|github\.com\/sopel-irc\/sopel)',
re=True,
online=True)
online=True,
vcr=True)
def duck(bot, trigger):
"""Queries DuckDuckGo for the specified input."""
query = trigger.group(2)
Expand Down
8 changes: 5 additions & 3 deletions sopel/modules/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ def tr(bot, trigger):
@commands('translate', 'tr')
@example('.tr :en :fr my dog',
'"mon chien" (en to fr, translate.google.com)',
online=True)
@example('.tr מחשב', '"computer" (iw to en, translate.google.com)', online=True)
online=True, vcr=True)
@example('.tr מחשב',
'"computer" (iw to en, translate.google.com)',
online=True, vcr=True)
@example('.tr mon chien',
'"my dog" (fr to en, translate.google.com)',
online=True)
online=True, vcr=True)
def tr2(bot, trigger):
"""Translates a phrase, with an optional language hint."""
command = trigger.group(2)
Expand Down
2 changes: 1 addition & 1 deletion sopel/modules/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def shutdown(bot):
@module.example(
'.title https://www.google.com',
'[ Google ] - www.google.com',
online=True)
online=True, vcr=True)
def title_command(bot, trigger):
"""
Show the title or URL information for the given URL, or the last URL seen
Expand Down
24 changes: 24 additions & 0 deletions test/vcr/modules/isup/test_example_isup_0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
interactions:
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
User-Agent: [python-requests/2.23.0]
method: HEAD
uri: http://google.com/
response:
body: {string: ''}
headers:
Cache-Control: ['public, max-age=2592000']
Content-Length: ['219']
Content-Type: [text/html; charset=UTF-8]
Date: ['Tue, 19 May 2020 22:12:25 GMT']
Expires: ['Thu, 18 Jun 2020 22:12:25 GMT']
Location: ['http://www.google.com/']
Server: [gws]
X-Frame-Options: [SAMEORIGIN]
X-XSS-Protection: ['0']
status: {code: 301, message: Moved Permanently}
version: 1
23 changes: 23 additions & 0 deletions test/vcr/modules/py/test_example_py_0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
interactions:
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
User-Agent: [python-requests/2.23.0]
method: GET
uri: https://oblique.sopel.chat/py/len%28%5B1%2C2%2C3%5D%29
response:
body: {string: '3

'}
headers:
Cache-Control: [no-cache]
Content-Length: ['2']
Content-Type: [text/plain]
Date: ['Tue, 19 May 2020 22:12:26 GMT']
Server: [Google Frontend]
X-Cloud-Trace-Context: [ed0f69d3ecb92a108aa223368b6282b1;o=1]
status: {code: 200, message: OK}
version: 1
239 changes: 239 additions & 0 deletions test/vcr/modules/search/test_example_duck_0.yaml

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions test/vcr/modules/search/test_example_duck_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
interactions:
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
User-Agent: [python-requests/2.23.0]
method: GET
uri: https://api.duckduckgo.com/?format=json&no_html=1&no_redirect=1&q=site%3Agrandorder.wiki+chulainn+alter
response:
body:
string: !!binary |
H4sIAAAAAAAAA1WPwQqDMBBE/2XPfoE3oQUFT9bSQ+khJmtciIkkK1VK/72gsepxZ2fezn6g6IVG
SAESyJrAXkiuceJVWZYPUtydHTc3ehlTF2zJEpOz96o82/7CwsmRdBfBPbKA1I7GJHC1TDyvyQoV
eZTH80UonXYRbMMbfexmW9e46XxxnfZKG9UIRlW7gWSA9PlKoJ6H2D9HocjqzRlGw9GzY47/ZkuH
Lf/9AW7ExRVCAQAA
headers:
Access-Control-Allow-Origin: ['*']
Cache-Control: [max-age=1]
Connection: [keep-alive]
Content-Encoding: [gzip]
Content-Security-Policy: ['default-src https: blob: data: ''unsafe-inline''
''unsafe-eval''; frame-ancestors ''self''']
Content-Type: [application/x-javascript]
Date: ['Tue, 19 May 2020 22:14:39 GMT']
Expect-CT: [max-age=0]
Expires: ['Tue, 19 May 2020 22:14:40 GMT']
Referrer-Policy: [origin]
Server: [nginx]
Server-Timing: [total;dur=12;desc="Backend Total"]
Strict-Transport-Security: [max-age=31536000]
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
X-Content-Type-Options: [nosniff]
X-DuckDuckGo-Locale: [en_US]
X-DuckDuckGo-Results: ['1']
X-Frame-Options: [SAMEORIGIN]
X-XSS-Protection: [1;mode=block]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
User-Agent: ['Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/55.0.2883.87 Safari/537.36']
method: GET
uri: https://duckduckgo.com/html/?kl=us-en&q=site%3Agrandorder.wiki+chulainn+alter
response:
body:
string: !!binary |
H4sIAAAAAAAAA+1dS3fbuJLe51egOaf7OmdM0bJjO3ZkzbEd59GdpD2x07k999zDA4mQiIivgKBk
ZTWb2c56tvMbZne3/U/uL5kCQUp8QDKY2PfIN+zTSUQSVQAKQH2oKjx6Pzz/9fz698sL5HLfQ5cf
zt68PkeGaVkf984t6/n1c/TnV9dv36BuZwddMxzElNMwwJ5lXbwzkOFyHh1b1mw268z2OiEbW9fv
rRvBqyuIs58mL1B2HO4Y/UePej+Y5l/oCL2+QAd/7ffS/IcejuMTg5IDA934XgC/6zl0j46OJGOj
3/vhLyRw6OivptkvcjyscPS4SclTlP5z9I28n6p4fxPTMRdSEHxBJpkoNKtvmmURuAQ7/UcI9XzC
MTQqj0zyOaHTE2MYBpwE3OTziBgoezoxOLnhlhD+MzR0MYsJP/lw/cJ8aiBrySfAPjkxppTMopDx
AvWMOtw9cciUDomZPmwjGkAfwZ4ZD7FHTqDjbCMf31A/8bNXe+JVEhOWPuOBSKXIjpERYYywQnYh
o2MaKNK+woHjEs95wSj0B29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alive]
Content-Encoding: [gzip]
Content-Security-Policy: ['default-src https: blob: data: ''unsafe-inline''
''unsafe-eval''; frame-ancestors ''self''']
Content-Type: [text/html; charset=UTF-8]
Date: ['Tue, 19 May 2020 22:14:40 GMT']
Expect-CT: [max-age=0]
Expires: ['Tue, 19 May 2020 22:14:41 GMT']
Referrer-Policy: [origin]
Server: [nginx]
Server-Timing: [total;dur=623;desc="Backend Total"]
Set-Cookie: ['kl=us-en; Secure; HttpOnly; SameSite=Strict;Expires=Wed, 19 May
2021 22:14:39 GMT;']
Strict-Transport-Security: [max-age=31536000]
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
X-Content-Type-Options: [nosniff]
X-DuckDuckGo-Locale: [en_US]
X-Frame-Options: [SAMEORIGIN]
X-XSS-Protection: [1;mode=block]
status: {code: 200, message: OK}
version: 1
49 changes: 49 additions & 0 deletions test/vcr/modules/translate/test_example_tr2_0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
interactions:
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
User-Agent: [Mozilla/5.0(X11; U; Linux i686)Gecko/20071127 Firefox/2.0.0.11]
method: GET
uri: https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&q=mon+chien
response:
body: {string: '[[["my dog","mon chien",null,null,1]

]

,null,"fr",null,null,null,1.0,[]

,[["fr"]

,null,[1.0]

,["fr"]

]

]

'}
headers:
Accept-Ranges: [none]
Access-Control-Allow-Origin: ['*']
Alt-Svc: ['h3-27=":443"; ma=2592000,h3-25=":443"; ma=2592000,h3-T050=":443";
ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443";
ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443";
ma=2592000; v="46,43"']
Cache-Control: ['no-cache, no-store, max-age=0, must-revalidate']
Content-Disposition: [attachment; filename="json.txt"; filename*=UTF-8''json.txt]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 19 May 2020 22:12:42 GMT']
Expires: ['Mon, 01 Jan 1990 00:00:00 GMT']
Pragma: [no-cache]
Server: [ESF]
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
X-Content-Type-Options: [nosniff]
X-Frame-Options: [SAMEORIGIN]
X-XSS-Protection: ['0']
status: {code: 200, message: OK}
version: 1
33 changes: 33 additions & 0 deletions test/vcr/modules/translate/test_example_tr2_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
interactions:
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
User-Agent: [Mozilla/5.0(X11; U; Linux i686)Gecko/20071127 Firefox/2.0.0.11]
method: GET
uri: https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&q=%D7%9E%D7%97%D7%A9%D7%91
response:
body: {string: "[[[\"computer\",\"\u05DE\u05D7\u05E9\u05D1\",null,null,2]\n]\n,null,\"iw\",null,null,null,1.0,[]\n,[[\"iw\"]\n,null,[1.0]\n,[\"iw\"]\n]\n]\n"}
headers:
Accept-Ranges: [none]
Access-Control-Allow-Origin: ['*']
Alt-Svc: ['h3-27=":443"; ma=2592000,h3-25=":443"; ma=2592000,h3-T050=":443";
ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443";
ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443";
ma=2592000; v="46,43"']
Cache-Control: ['no-cache, no-store, max-age=0, must-revalidate']
Content-Disposition: [attachment; filename="json.txt"; filename*=UTF-8''json.txt]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 19 May 2020 22:12:43 GMT']
Expires: ['Mon, 01 Jan 1990 00:00:00 GMT']
Pragma: [no-cache]
Server: [ESF]
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
X-Content-Type-Options: [nosniff]
X-Frame-Options: [SAMEORIGIN]
X-XSS-Protection: ['0']
status: {code: 200, message: OK}
version: 1
Loading

0 comments on commit 5c721e2

Please sign in to comment.