Revision: 144
Author: janne.t.harkonen
Date: Wed Aug 22 21:55:24 2012
Log: LogLevelEntry: validate given value
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=144
Modified:
/trunk/src/SSHLibrary/config.py
=======================================
--- /trunk/src/SSHLibrary/config.py Wed Aug 22 21:55:10 2012
+++ /trunk/src/SSHLibrary/config.py Wed Aug 22 21:55:24 2012
@@ -91,8 +91,13 @@
Given string must be on of 'TRACE', 'DEBUG', 'INFO' or 'WARN', case
insensitively.
"""
+ LEVELS = ('TRACE', 'DEBUG', 'INFO', 'WARN')
+
def _parse_value(self, value):
- return value.upper()
+ value = value.upper()
+ if value not in self.LEVELS:
+ raise ConfigurationException('Invalid log level: %s' % value)
+ return value
class NewlineEntry(Entry):