mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 09:02:12 +00:00 
			
		
		
		
	Merge pull request #92 from ep1cman/fixes
AndroidDevice: Removed duplicate parameter
This commit is contained in:
		@@ -78,8 +78,6 @@ class AndroidDevice(BaseLinuxDevice):  # pylint: disable=W0223
 | 
				
			|||||||
                  If set a swipe of the specified direction will be performed.
 | 
					                  If set a swipe of the specified direction will be performed.
 | 
				
			||||||
                  This should unlock the screen.
 | 
					                  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
 | 
					    default_timeout = 30
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,7 +82,12 @@ class AttributeCollection(object):
 | 
				
			|||||||
        return p
 | 
					        return p
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __iadd__(self, other):
 | 
					    def __iadd__(self, other):
 | 
				
			||||||
 | 
					        other = [self._to_attrcls(p) for p in other]
 | 
				
			||||||
 | 
					        names = []
 | 
				
			||||||
        for p in other:
 | 
					        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)
 | 
					            self.add(p)
 | 
				
			||||||
        return self
 | 
					        return self
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -687,4 +692,3 @@ class Module(Extension):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def initialize(self, context):
 | 
					    def initialize(self, context):
 | 
				
			||||||
        pass
 | 
					        pass
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -320,6 +320,13 @@ class ParametersTest(TestCase):
 | 
				
			|||||||
        myext = _instantiate(MyOtherExtension, mandatory=1, optional='invalid')
 | 
					        myext = _instantiate(MyOtherExtension, mandatory=1, optional='invalid')
 | 
				
			||||||
        myext.validate()
 | 
					        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):
 | 
					class ModuleTest(TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -340,4 +347,3 @@ class ModuleTest(TestCase):
 | 
				
			|||||||
def _instantiate(cls, *args, **kwargs):
 | 
					def _instantiate(cls, *args, **kwargs):
 | 
				
			||||||
    # Needed to get around Extension's __init__ checks
 | 
					    # Needed to get around Extension's __init__ checks
 | 
				
			||||||
    return cls(*args, **kwargs)
 | 
					    return cls(*args, **kwargs)
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user