myGengo/mygengo-python — Issue #3: Failing tests 1.3.2
Author: ksperkins
Created: 2011-10-23 15:40:54+00:00
State: open

In tests.py, test_getJobDataMethods, two tests fail.

Call to getTranslationJobs fails because the entry in mockdb.py has a trailing {{ids}}. There are two api functions listed on myGengo API, translate/jobs and translate/jobs/{ids}, neither of which will be correctly called based on the mockdb entry. The test appears to be targeting the translate/jobs function and removing {{ids}} from the mockdb entry allows it to pass.

Call to getTranslationJobBatch fails because it attempts to pass a single job id in place of a group id. The myGengo API function translate/jobs/group/{group_id} only seems to work if passing a group id that is the result of submitting multiple jobs with the as_group = 1 (and the multiple jobs can be performed as a group, i.e. same languages and tier).
Even if a proper group_id was available and assigned in the call to getTranslationJobBatch, the definition in mockdb has the replacement parameter {{group_id}}. However, the code in class MyGengo get that uses a regular expression substitution (142-146) does not include the _ (underscore) character in the character class, so group_id will never be matched.