Image Link
Solve the problem:
In[]:=
BeeCrowdProblem1019TimeConversion//ClearAll​​​​BeeCrowdProblem1019TimeConversion[n_]:=TemplateApply["`hours`:`minutes`:`seconds`",AssociationThread[{"hours","minutes","seconds"}->Identity@@QuantityMagnitude[UnitConvert[Quantity[n,"Seconds"],MixedUnit[{"Hours","Minutes","Seconds"}]]]]]
Here is a simple example of running a single test.
Create a list of tests with 1 test:
In[]:=
tests=Table[With[{input=input,output="0:9:16"},TestCreate[BeeCrowdProblem1019TimeConversion[input],output,TestID->Automatic]],{input,{556}}]
Out[]=
TestObject
Outcome: NotEvaluated
Test ID:
acd78ab6-9d2e-4a4a-a1bb-76294a0e2602

Get a test report:
In[]:=
TestReport[tests]
Out[]=
TestReportObject
Tests count: 1
Success rate: 100%

Echo the tests:
In[]:=
TestReport[tests,HandlerFunctions-><|"TestEvaluated"->Echo|>]
»
EventTestEvaluated,EventID23afd38e-dfff-460c-b8e9-881065cea4b1,TestObjectTestObject
Outcome: Success
Test ID:
acd78ab6-9d2e-4a4a-a1bb-76294a0e2602
Input:
BeeCrowdProblem1019TimeConversion[556]
Expected output:
0:9:16
Actual output:
0:9:16
,OutcomeSuccess
Out[]=
TestReportObject
Tests count: 1
Success rate: 100%

Run tests with MapThread to take all the inputs in one list and all the outputs in another list:
In[]:=
MapThread[{input,output}With[{input=input,output=output},TestCreate[BeeCrowdProblem1019TimeConversion[input],output,TestID->Automatic]],{{556},{"0:9:16"}}]
Out[]=
TestObject
Outcome: NotEvaluated
Test ID:
416cf10a-5509-46bb-bfe5-820553e9acfb

I tried this but it didn't work:
In[]:=
MapThread[f,{556},{"0:9:16"}]
Out[]=
MapThread[f,{556},{0:9:16}]
This works:
In[]:=
MapThread[f,{{556},{"0:9:16"}}]
Out[]=
{f[556,0:9:16]}
Here it is again:
In[]:=
MapThread[{input,output}With[{input=input,output=output},TestCreate[BeeCrowdProblem1019TimeConversion[input],output,TestID->Automatic]],{{556},{"0:9:16"}}]
Out[]=
TestObject
Outcome: NotEvaluated
Test ID:
39290664-e4ef-4ee4-866e-1daa4751a194

I was curious how you define a pure function that takes two arguments, so I created a simple test case with GCD:
In[]:=
myGCD={p,q}GCD[p,q]
Out[]=
Function[{p,q},GCD[p,q]]
It doesn't work with a list:
In[]:=
myGCD[{3,12}]
Out[]=
Function[{p,q},GCD[p,q]][{3,12}]
It does work with a sequence:
In[]:=
myGCD[3,12]
Out[]=
3
Here I assign the variable tests to a MapThread instead of a Table:
In[]:=
tests=MapThread[{input,output}With[{input=input,output=output},TestCreate[BeeCrowdProblem1019TimeConversion[input],output,TestID->Automatic]],{{556},{"0:9:16"}}]
Out[]=
TestObject
Outcome: NotEvaluated
Test ID:
a9844031-02cd-49fa-af5f-f8d16cbec8ff

I run the tests:
In[]:=
TestReport[tests]
Out[]=
TestReportObject
Tests count: 1
Success rate: 100%

I run the tests with the handler function echo for evaluated tests:
In[]:=
TestReport[tests,HandlerFunctions-><|"TestEvaluated"->Echo|>]
»
EventTestEvaluated,EventIDc812e515-a826-458c-8266-a5e009424b81,TestObjectTestObject
Outcome: Success
Test ID:
1f4f8020-0338-40ba-a644-382f831af8ee
,OutcomeSuccess
Out[]=
TestReportObject
Tests count: 1
Success rate: 100%

Now I store all the inputs in one list and all the outputs in another list, and run the tests with and without the option handler functions.
In[]:=
inputs={556,1,140153};
In[]:=
outputs={"0:9:16","0:0:1","38:55:53"};
Create the tests:
In[]:=
tests=MapThread[{input,output}With[{input=input,output=output},TestCreate[BeeCrowdProblem1019TimeConversion[input],output,TestID->Automatic]],{inputs,outputs}];
Run the tests:
In[]:=
TestReport[tests]
Out[]=
TestReportObject
Tests count: 3
Success rate: 100%

Run the tests with a handler function:
In[]:=
TestReport[tests,HandlerFunctions-><|"TestEvaluated"->Echo|>]
»
EventTestEvaluated,EventID2ddbcb40-edab-4e25-a687-88806fcbae72,TestObjectTestObject
Outcome: Success
Test ID:
ca17a58d-bb9a-4b97-a8fd-9fc13f28357f
Input:
BeeCrowdProblem1019TimeConversion[556]
Expected output:
0:9:16
Actual output:
0:9:16
,OutcomeSuccess
»
EventTestEvaluated,EventID94e9faf1-0e8a-4b47-9728-6cd6ff999c2f,TestObjectTestObject
Outcome: Success
Test ID:
f7ee5dc3-9a10-4602-a1dd-9e6f67a7437c
Input:
BeeCrowdProblem1019TimeConversion[1]
Expected output:
0:0:1
Actual output:
0:0:1
,OutcomeSuccess
»
EventTestEvaluated,EventIDfba9885a-adf3-4644-a0f1-d28f0f55683a,TestObjectTestObject
Outcome: Success
Test ID:
0205b3e6-86ab-4124-a0aa-b24d24aa7480
Input:
BeeCrowdProblem1019TimeConversion[140153]
Expected output:
38:55:53
Actual output:
38:55:53
,OutcomeSuccess
Deploy the function as an API.
The benefit of this API is you could theoretically use this to solve a programming challenge that you couldn't use the Wolfram Language for like Python or Java or Ruby with EmbedCode, but I have not been able to get this to work on beecrowd or hackerrank. Python requires the wolframclient dependency, which is not supported.
Run tests with the API:
I got the tests to work:
One problem was that if I didn't use ToExpression it wouldn't work:
If we look at the FullForm there's a difference:
We can apply ToExpression to fix this.
Now these should be the same
Maybe I'll figure out why they are still different if I look at the FullForm
Now I can make them equal.
So use ToExpression when testing if a string is equal with URLExecute.