mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +00:00
Merge pull request #92 from ep1cman/fixes
AndroidDevice: Removed duplicate parameter
This commit is contained in:
commit
28ef01505d
@ -78,8 +78,6 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
|
||||
If set a swipe of the specified direction will be performed.
|
||||
This should unlock the screen.
|
||||
"""),
|
||||
Parameter('binaries_directory', default="/data/local/tmp", override=True,
|
||||
description='Location of executable binaries on this device (must be in PATH).'),
|
||||
]
|
||||
|
||||
default_timeout = 30
|
||||
|
@ -82,7 +82,12 @@ class AttributeCollection(object):
|
||||
return p
|
||||
|
||||
def __iadd__(self, other):
|
||||
other = [self._to_attrcls(p) for p in other]
|
||||
names = []
|
||||
for p in other:
|
||||
if p.name in names:
|
||||
raise ValueError("Duplicate '{}' {}".format(p.name, p.__class__.__name__.split('.')[-1]))
|
||||
names.append(p.name)
|
||||
self.add(p)
|
||||
return self
|
||||
|
||||
@ -687,4 +692,3 @@ class Module(Extension):
|
||||
|
||||
def initialize(self, context):
|
||||
pass
|
||||
|
||||
|
@ -320,6 +320,13 @@ class ParametersTest(TestCase):
|
||||
myext = _instantiate(MyOtherExtension, mandatory=1, optional='invalid')
|
||||
myext.validate()
|
||||
|
||||
@raises(ValueError)
|
||||
def test_duplicate_param_override(self):
|
||||
class DuplicateParamExtension(MyBaseExtension): # pylint: disable=W0612
|
||||
parameters = [
|
||||
Parameter('food', override=True, default='cheese'),
|
||||
Parameter('food', override=True, default='cheese'),
|
||||
]
|
||||
|
||||
class ModuleTest(TestCase):
|
||||
|
||||
@ -340,4 +347,3 @@ class ModuleTest(TestCase):
|
||||
def _instantiate(cls, *args, **kwargs):
|
||||
# Needed to get around Extension's __init__ checks
|
||||
return cls(*args, **kwargs)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user