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

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

Issue 2747023002: Cleanup machine based on the state in configuration file for mini installer test.
Patch Set: refactor to use visitor pattern Created 3 years, 9 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 5
6 class Verifier: 6 class Verifier:
7 """Verifies that the current machine states match the expectation.""" 7 """Verifies that the current machine states match the expectation."""
8 8
9 def VerifyInput(self, verifier_input, variable_expander): 9 def VerifyInput(self, verifier_input, variable_expander):
10 """Verifies that the current machine states match |verifier_input|. 10 """Verifies that the current machine states match |verifier_input|.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 def _EvaluateCondition(self, condition): 43 def _EvaluateCondition(self, condition):
44 """Evaluates |condition| using eval(). 44 """Evaluates |condition| using eval().
45 45
46 Args: 46 Args:
47 condition: A condition string. 47 condition: A condition string.
48 48
49 Returns: 49 Returns:
50 The result of the evaluated condition. 50 The result of the evaluated condition.
51 """ 51 """
52 return eval(condition, {'__builtins__': {'False': False, 'True': True}}) 52 return eval(condition, {'__builtins__': {'False': False, 'True': True}})
53
54 def _Assert(self, is_true, message):
55 """ Check whether the test result equals to the expectation.
56
57 Args:
58 is_true: A boolean represents whether the assert is success.
59 message: The error message if assert failed.
60 """
61 assert is_true, message
OLDNEW
« no previous file with comments | « chrome/test/mini_installer/variable_expander.py ('k') | chrome/test/mini_installer/verifier_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698