1 def execute(eyetracker):
2 license_file_path =
"../licenses/se_internal_license_for_system_tests" 5 import tobii_research
as tr
7 print(
"Applying license from {0}.".format(license_file_path))
8 with open(license_file_path,
"rb")
as f:
11 failed_licenses_applied_as_list_of_keys = eyetracker.apply_licenses([tr.LicenseKey(license)])
12 failed_licenses_applied_as_list_of_bytes = eyetracker.apply_licenses([license])
13 failed_licenses_applied_as_key = eyetracker.apply_licenses(tr.LicenseKey(license))
14 failed_licenses_applied_as_bytes = eyetracker.apply_licenses(license)
16 if len(failed_licenses_applied_as_list_of_keys) == 0:
17 print(
"Successfully applied license from list of keys.")
19 print(
"Failed to apply license from list of keys. Validation result: {0}.".
20 format(failed_licenses_applied_as_list_of_keys[0].validation_result))
22 if len(failed_licenses_applied_as_list_of_bytes) == 0:
23 print(
"Successfully applied license from list of bytes.")
25 print(
"Failed to apply license from list of bytes. Validation result: {0}.".
26 format(failed_licenses_applied_as_list_of_bytes[0].validation_result))
28 if len(failed_licenses_applied_as_key) == 0:
29 print(
"Successfully applied license from single key.")
31 print(
"Failed to apply license from single key. Validation result: {0}.".
32 format(failed_licenses_applied_as_key[0].validation_result))
34 if len(failed_licenses_applied_as_bytes) == 0:
35 print(
"Successfully applied license from bytes object.")
37 print(
"Failed to apply license from bytes object. Validation result: {0}.".
38 format(failed_licenses_applied_as_bytes[0].validation_result))