mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Remove a subclass from test_Amazon.
Only quote words in Amazon results if they are not being bolded.
This commit is contained in:
parent
9441f1487e
commit
61dbf12016
@ -109,8 +109,11 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
results[v] = getattr(results[v], k[:-1], 'unknown')
|
results[v] = getattr(results[v], k[:-1], 'unknown')
|
||||||
if not isinstance(results[v], basestring):
|
if not isinstance(results[v], basestring):
|
||||||
results[v] = utils.commaAndify(results[v])
|
results[v] = utils.commaAndify(results[v])
|
||||||
if bold and bold_item in results:
|
if bold_item in results:
|
||||||
results[bold_item] = ircutils.bold(results[bold_item])
|
if bold:
|
||||||
|
results[bold_item] = ircutils.bold(results[bold_item])
|
||||||
|
else:
|
||||||
|
results[bold_item] = '"%s"' % results[bold_item]
|
||||||
if not url:
|
if not url:
|
||||||
results['url'] = ''
|
results['url'] = ''
|
||||||
else:
|
else:
|
||||||
@ -146,7 +149,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s", written by %(author)s; published by ' \
|
s = '%(title)s, written by %(author)s; published by ' \
|
||||||
'%(publisher)s; price: %(price)s%(url)s'
|
'%(publisher)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
book = amazon.searchByKeyword(isbn)
|
book = amazon.searchByKeyword(isbn)
|
||||||
@ -180,7 +183,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s", written by %(author)s; published by ' \
|
s = '%(title)s, written by %(author)s; published by ' \
|
||||||
'%(publisher)s; price: %(price)s%(url)s'
|
'%(publisher)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
books = amazon.searchByKeyword(keyword)
|
books = amazon.searchByKeyword(keyword)
|
||||||
@ -220,7 +223,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s" (%(media)s), rated %(mpaa)s; released ' \
|
s = '%(title)s (%(media)s), rated %(mpaa)s; released ' \
|
||||||
'%(date)s; published by %(publisher)s; price: %(price)s%(url)s'
|
'%(date)s; published by %(publisher)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
videos = amazon.searchByKeyword(keyword, product_line=product)
|
videos = amazon.searchByKeyword(keyword, product_line=product)
|
||||||
@ -253,7 +256,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s"; price: %(price)s%(url)s'
|
s = '%(title)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
item = amazon.searchByASIN(asin)
|
item = amazon.searchByASIN(asin)
|
||||||
bold = self.registryValue('bold', msg.args[0])
|
bold = self.registryValue('bold', msg.args[0])
|
||||||
@ -288,7 +291,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s" %(manufacturer)s; price: %(price)s%(url)s'
|
s = '%(title)s %(manufacturer)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
item = amazon.searchByUPC(upc)
|
item = amazon.searchByUPC(upc)
|
||||||
bold = self.registryValue('bold', msg.args[0])
|
bold = self.registryValue('bold', msg.args[0])
|
||||||
@ -321,7 +324,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s", written by %(author)s; published by ' \
|
s = '%(title)s, written by %(author)s; published by ' \
|
||||||
'%(publisher)s; price: %(price)s%(url)s'
|
'%(publisher)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
books = amazon.searchByAuthor(author)
|
books = amazon.searchByAuthor(author)
|
||||||
@ -420,7 +423,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s" (%(media)s), by %(artist)s; published by ' \
|
s = '%(title)s (%(media)s), by %(artist)s; published by ' \
|
||||||
'%(publisher)s; price: %(price)s%(url)s'
|
'%(publisher)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
items = amazon.searchByArtist(artist, product_line=product)
|
items = amazon.searchByArtist(artist, product_line=product)
|
||||||
@ -461,7 +464,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s" (%(media)s), rated %(mpaa)s; released ' \
|
s = '%(title)s (%(media)s), rated %(mpaa)s; released ' \
|
||||||
'%(date)s; published by %(publisher)s; price: %(price)s%(url)s'
|
'%(date)s; published by %(publisher)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
items = amazon.searchByActor(actor, product_line=product)
|
items = amazon.searchByActor(actor, product_line=product)
|
||||||
@ -502,7 +505,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s" (%(media)s), rated %(mpaa)s; released ' \
|
s = '%(title)s (%(media)s), rated %(mpaa)s; released ' \
|
||||||
'%(date)s; published by %(publisher)s; price: %(price)s%(url)s'
|
'%(date)s; published by %(publisher)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
items = amazon.searchByDirector(director, product_line=product)
|
items = amazon.searchByDirector(director, product_line=product)
|
||||||
@ -542,7 +545,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'URL' : 'url'
|
'URL' : 'url'
|
||||||
}
|
}
|
||||||
s = '"%(title)s"; price: %(price)s%(url)s'
|
s = '%(title)s; price: %(price)s%(url)s'
|
||||||
try:
|
try:
|
||||||
items = amazon.searchByManufacturer(manufacturer,
|
items = amazon.searchByManufacturer(manufacturer,
|
||||||
product_line=product)
|
product_line=product)
|
||||||
@ -572,7 +575,7 @@ class Amazon(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
'OurPrice' : 'price',
|
'OurPrice' : 'price',
|
||||||
'Artists' : 'artist',
|
'Artists' : 'artist',
|
||||||
}
|
}
|
||||||
s = '"%(title)s"; %(artist)s; %(author)s; %(mpaa)s; %(media)s; '\
|
s = '%(title)s; %(artist)s; %(author)s; %(mpaa)s; %(media)s; '\
|
||||||
'%(date)s; %(publisher)s; price: %(price)s'
|
'%(date)s; %(publisher)s; price: %(price)s'
|
||||||
try:
|
try:
|
||||||
item = amazon.searchByASIN(match)
|
item = amazon.searchByASIN(match)
|
||||||
|
@ -34,7 +34,7 @@ from testsupport import *
|
|||||||
LICENSE_KEY = 'AMAZONS_NOT_CHECKING_KEYS'
|
LICENSE_KEY = 'AMAZONS_NOT_CHECKING_KEYS'
|
||||||
|
|
||||||
if LICENSE_KEY != 'INITIAL_NON_LICENSE_KEY' and network:
|
if LICENSE_KEY != 'INITIAL_NON_LICENSE_KEY' and network:
|
||||||
class AmazonTestCase(PluginTestCase, PluginDocumentation):
|
class AmazonTestCase(PluginTestCase):
|
||||||
plugins = ('Amazon',)
|
plugins = ('Amazon',)
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
PluginTestCase.setUp(self)
|
PluginTestCase.setUp(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user