Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: chrome/test/mini_installer/verifier.py

Issue 22480002: Use unittest framework in the Automated Installer Testing Framework. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Change verifiers to classes. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import registry_verifier 5 from registry_verifier import RegistryVerifier
6 6
7 def Verify(property): 7 class Verifier:
8 """Verifies that the current machine states match the property object.""" 8 """Verifies that the current machine state matches the expected machine
9 for verifier_name, value in property.iteritems(): 9 state."""
10 if verifier_name == 'RegistryEntries': 10
11 registry_verifier.VerifyRegistryEntries(value) 11 def __init__(self, testcase):
12 else: 12 """Constructor.
13 # TODO(sukolsak): Implement other verifiers 13
14 # TODO(sukolsak): Use unittest framework instead of exceptions. 14 Args:
15 raise Exception('Unknown verifier') 15 testcase: A unittest.TestCase instance.
16 """
17 self.testcase = testcase
18 self.registry_verifier = RegistryVerifier(testcase)
gab 2013/08/08 02:07:08 How about a single dictionary of verifiers, e.g.:
robertshield 2013/08/09 19:00:15 I agree with the notion of having Verifiers derive
19
20 def Verify(self, property):
robertshield 2013/08/09 19:00:15 If the comment above is followed, this would then
sukolsak 2013/08/09 21:12:38 Done.
21 """Verifies that the current machine states match the property dictionary.
22
23 Args:
24 property: A property dictionary.
25 """
26 for verifier_name, value in property.iteritems():
27 if verifier_name == 'RegistryEntries':
28 self.registry_verifier.VerifyRegistryEntries(value)
29 else:
30 # TODO(sukolsak): Implement other verifiers
31 self.testcase.fail('Unknown verifier %s' % verifier_name)
OLDNEW
« chrome/test/mini_installer/test_installer.py ('K') | « chrome/test/mini_installer/test_installer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698