This may not be a definite answer to your problem, but you currently have the possibility to transform your received message on the fly before matching it with a template. This is done via the with_() function that does not necessarily takes a codec identifier as a first argument, but can accept any callable() (a function) to transform the incoming data first.
class TC_TEST(TestCase):
def body(self, **kwargs):
message = "2013-06-12"
template = with_(lambda x: x.replace("-", ""), "20130612")
if match(message, template):
setverdict(PASS)
else:
setverdict(FAIL)
TC_TEST().execute()
In the template, the with_(lambda x: x.replace("-", ""), "20130612") first purges the '-' in the incoming messages before checking the value.
You may create a more complex function to transform multiple date formats into a single "reference" one that would be used for matching:
def my_function_to_convert_dates(d):
# always return a date as a (float) timestamp
# ...
...
template = with_(my_function_to_convert_date, 123456789.12)
---
Alternatively, you can create your own matching objects by modifying the TestermanTTCN3.py code.
In that case, you should create your own CustomTestermanTTCN3.py by copy (for instance), then on server side in conf/language-apis.conf create new lines from the existing *.1 entries:
testerman.te.python.module.api.2 = CustomTestermanTTCN3
testerman.te.python.dependencies.api.2 = <the same as for api.1, replace TestermanTTCN3.py with CustomTestermanTTCN3.py>
This create a new "TTCN3 provider" entry whose ID is 2.
Then, in your ATS, from QTesterman, check the "ATS properties" and change the language API to 2 to use your custom modules.
This way, you can alter the TTCN3 implementation on will without impacting the "official" Testerman API.
Since you won't inherit from the "official" addons and fixes, the first approach, if applicable in your case, should be better.
thanks,
-seb