diff options
author | Yiting.Li <liyiting@huawei.com> | 2016-01-19 14:39:31 +0800 |
---|---|---|
committer | Yiting.Li <liyiting@huawei.com> | 2016-01-19 14:39:31 +0800 |
commit | 5b4f794932cb9b28ec679e6dd88e6febb2a5db7b (patch) | |
tree | d7b2615275a93ef1c2c878a0732b687832267174 /vstf/vstf/controller/reporters/report/provider/pdf_provider.py | |
parent | 827a986f4abc404dc803380a25d5e9ade7448f67 (diff) |
JIRA: BOTTLENECKS-29
add the performance test framework
add the copyright on the code.
Change-Id: I6ec9eefe65bf07c2dd6c636d1b90b64da303952e
Signed-off-by: Yiting.Li <liyiting@huawei.com>
Diffstat (limited to 'vstf/vstf/controller/reporters/report/provider/pdf_provider.py')
-rwxr-xr-x | vstf/vstf/controller/reporters/report/provider/pdf_provider.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/vstf/vstf/controller/reporters/report/provider/pdf_provider.py b/vstf/vstf/controller/reporters/report/provider/pdf_provider.py new file mode 100755 index 00000000..bc9f0e96 --- /dev/null +++ b/vstf/vstf/controller/reporters/report/provider/pdf_provider.py @@ -0,0 +1,51 @@ +############################################################################## +# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + + +__version__ = ''' ''' +import logging + +LOG = logging.getLogger(__name__) +from vstf.controller.settings.template_settings import TemplateSettings + + +class PdfProvider(object): + def __init__(self, info): + self._info = info + + @property + def get_theme(self): + assert "theme" in self._info + return self._info["theme"] + + @property + def ifcontents(self): + assert "contents" in self._info + assert "enable" in self._info["contents"] + return self._info["contents"]["enable"] + + @property + def get_context(self): + assert "context" in self._info + return self._info["context"] + + +def main(): + from vstf.common.log import setup_logging + setup_logging(level=logging.DEBUG, log_file="/var/log/pdf-provider.log", clevel=logging.INFO) + + info = TemplateSettings() + provider = PdfProvider(info.settings) + LOG.info(provider.get_theme) + LOG.info(provider.ifcontents) + LOG.info(provider.get_context) + +if __name__ == '__main__': + main()
\ No newline at end of file |