addons.view: we no longer have a None order state

This bumps coverage back to 100% for addons
This commit is contained in:
Aldo Cortesi 2017-03-20 09:12:09 +13:00
parent b19fefd173
commit 2153c337e0

View File

@ -109,7 +109,7 @@ class View(collections.Sequence):
self.default_order = OrderRequestStart(self) self.default_order = OrderRequestStart(self)
self.orders = dict( self.orders = dict(
time = self.default_order, time = OrderRequestStart(self),
method = OrderRequestMethod(self), method = OrderRequestMethod(self),
url = OrderRequestURL(self), url = OrderRequestURL(self),
size = OrderKeySize(self), size = OrderKeySize(self),
@ -310,14 +310,11 @@ class View(collections.Sequence):
) )
self.set_filter(filt) self.set_filter(filt)
if "console_order" in updated: if "console_order" in updated:
if opts.console_order is None: if opts.console_order not in self.orders:
self.set_order(self.default_order) raise exceptions.OptionsError(
else: "Unknown flow order: %s" % opts.console_order
if opts.console_order not in self.orders: )
raise exceptions.OptionsError( self.set_order(self.orders[opts.console_order])
"Unknown flow order: %s" % opts.console_order
)
self.set_order(self.orders[opts.console_order])
if "console_order_reversed" in updated: if "console_order_reversed" in updated:
self.set_reversed(opts.console_order_reversed) self.set_reversed(opts.console_order_reversed)
if "console_focus_follow" in updated: if "console_focus_follow" in updated: