Source code for apama.basetest
#!/usr/bin/env python3
# Copyright (c) 2018-2020 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
# Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
import pysys
from os import path
[docs]class ApamaBaseTest(pysys.basetest.BaseTest):
"""
A custom PySys basetest for Apama tests.
Currently this base class exists only for compatibility reasons; you can continue to use it but assumimg you are
using the latest pysysproject.xml defaults, new Apama tests should directly subclass `pysys.basetest.BaseTest`
rather than this class.
"""
def __init__(self, descriptor, outsubdir, runner):
super(ApamaBaseTest, self).__init__(descriptor, outsubdir, runner)
[docs] def getDefaultFileEncoding(self, file, **xargs):
filename, file_extension = path.splitext(file)
# give first priority to super-class since for projects created with
# PySys 1.4.0+ these will be configured through the pysysproject.xml
# instead; this code is only for pre-Apama 10.5 project configs
delegated = super(ApamaBaseTest, self).getDefaultFileEncoding(file, **xargs)
if delegated: return delegated
if file_extension in ['xml', 'yaml', 'json', 'log']:
return 'utf-8'
else:
return None