Skip to content

Commit 4731c19

Browse files
committed
tests: better mocked responses
1 parent 274ef3b commit 4731c19

6 files changed

+85
-123
lines changed

tests/mock/responses/get_clash_of_code_from_handle.created.json

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,20 @@
33
"nbPlayersMax": 100,
44
"publicHandle": "1234567fedcba9876543210fedcba9876543210",
55
"clashDurationTypeId": "SHORT",
6-
"mode": "FASTEST",
7-
"startTimestamp": 1708107395331,
8-
"msBeforeStart": -26220184000,
9-
"msBeforeEnd": -26219284000,
10-
"finished": true,
11-
"started": true,
12-
"type": "PUBLIC",
6+
"startTimestamp": 1700000000000,
7+
"msBeforeStart": 5000,
8+
"finished": false,
9+
"started": false,
10+
"type": "PRIVATE",
1311
"players": [
1412
{
1513
"codingamerId": 1234567,
1614
"codingamerNickname": "Player 1",
1715
"codingamerHandle": "0123456789abcdef0123456789abcdef7654321",
18-
"score": 100,
19-
"duration": 120,
20-
"status": "STANDARD",
21-
"testSessionStatus": "COMPLETED",
22-
"languageId": "Python3",
23-
"rank": 1,
24-
"position": 2,
25-
"solutionShared": true,
26-
"testSessionHandle": "12345678fedcba9876543210fedcba9876543210",
27-
"submissionId": 12345678
28-
},
29-
{
30-
"codingamerId": 7654321,
31-
"codingamerNickname": "Player 2",
32-
"codingamerHandle": "fedcba9876543210fedcba98765432101234567",
33-
"score": 100,
34-
"duration": 300,
35-
"status": "STANDARD",
36-
"testSessionStatus": "COMPLETED",
37-
"languageId": "Python3",
38-
"rank": 2,
39-
"position": 3,
40-
"solutionShared": true,
41-
"testSessionHandle": "23456789edcba9876543210fedcba9876543210f",
42-
"submissionId": 23456789
43-
},
44-
{
45-
"codingamerId": 3456789,
46-
"codingamerNickname": "Player 3",
47-
"codingamerHandle": "ef0123456789abcdef0123456789abcd9876543",
48-
"codingamerAvatarId": 12345678901234,
49-
"score": 0,
50-
"duration": 240,
16+
"duration": 0,
5117
"status": "OWNER",
52-
"testSessionStatus": "COMPLETED",
53-
"languageId": "Python3",
54-
"rank": 3,
55-
"position": 1,
56-
"solutionShared": false,
57-
"testSessionHandle": "34567890dcba9876543210fedcba9876543210fe",
58-
"submissionId": 34567890
18+
"rank": 1,
19+
"position": 1
5920
}
6021
],
6122
"programmingLanguages": ["Python3"],

tests/mock/responses/get_clash_of_code_from_handle.finished.json

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,45 @@
33
"nbPlayersMax": 100,
44
"publicHandle": "1234567fedcba9876543210fedcba9876543210",
55
"clashDurationTypeId": "SHORT",
6-
"mode": "FASTEST",
7-
"startTimestamp": 1708107395331,
8-
"msBeforeStart": -26220184000,
9-
"msBeforeEnd": -26219284000,
6+
"mode": "SHORTEST",
7+
"startTimestamp": 1700000000000,
8+
"msBeforeStart": -905000,
9+
"msBeforeEnd": -5000,
1010
"finished": true,
1111
"started": true,
12-
"type": "PUBLIC",
12+
"type": "PRIVATE",
1313
"players": [
14-
{
15-
"codingamerId": 1234567,
16-
"codingamerNickname": "Player 1",
17-
"codingamerHandle": "0123456789abcdef0123456789abcdef7654321",
18-
"score": 100,
19-
"duration": 120,
20-
"status": "STANDARD",
21-
"testSessionStatus": "COMPLETED",
22-
"languageId": "Python3",
23-
"rank": 1,
24-
"position": 2,
25-
"solutionShared": true,
26-
"testSessionHandle": "12345678fedcba9876543210fedcba9876543210",
27-
"submissionId": 12345678
28-
},
2914
{
3015
"codingamerId": 7654321,
3116
"codingamerNickname": "Player 2",
3217
"codingamerHandle": "fedcba9876543210fedcba98765432101234567",
3318
"score": 100,
34-
"duration": 300,
19+
"duration": 200,
20+
"criterion": 100,
3521
"status": "STANDARD",
3622
"testSessionStatus": "COMPLETED",
3723
"languageId": "Python3",
38-
"rank": 2,
39-
"position": 3,
24+
"rank": 1,
25+
"position": 2,
4026
"solutionShared": true,
4127
"testSessionHandle": "23456789edcba9876543210fedcba9876543210f",
42-
"submissionId": 23456789
28+
"submissionId": 12345678
4329
},
4430
{
45-
"codingamerId": 3456789,
46-
"codingamerNickname": "Player 3",
47-
"codingamerHandle": "ef0123456789abcdef0123456789abcd9876543",
48-
"codingamerAvatarId": 12345678901234,
49-
"score": 0,
50-
"duration": 240,
31+
"codingamerId": 1234567,
32+
"codingamerNickname": "Player 1",
33+
"codingamerHandle": "0123456789abcdef0123456789abcdef7654321",
34+
"score": 100,
35+
"duration": 100,
36+
"criterion": 200,
5137
"status": "OWNER",
5238
"testSessionStatus": "COMPLETED",
5339
"languageId": "Python3",
54-
"rank": 3,
40+
"rank": 2,
5541
"position": 1,
5642
"solutionShared": false,
57-
"testSessionHandle": "34567890dcba9876543210fedcba9876543210fe",
58-
"submissionId": 34567890
43+
"testSessionHandle": "12345678fedcba9876543210fedcba9876543210",
44+
"submissionId": 23456789
5945
}
6046
],
6147
"programmingLanguages": ["Python3"],
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"nbPlayersMin": 2,
3+
"nbPlayersMax": 100,
4+
"publicHandle": "1234567fedcba9876543210fedcba9876543210",
5+
"clashDurationTypeId": "SHORT",
6+
"startTimestamp": 1700000000000,
7+
"msBeforeStart": 5000,
8+
"finished": false,
9+
"started": false,
10+
"type": "PRIVATE",
11+
"players": [
12+
{
13+
"codingamerId": 1234567,
14+
"codingamerNickname": "Player 1",
15+
"codingamerHandle": "0123456789abcdef0123456789abcdef7654321",
16+
"duration": 0,
17+
"status": "OWNER",
18+
"rank": 1,
19+
"position": 1
20+
},
21+
{
22+
"codingamerId": 7654321,
23+
"codingamerNickname": "Player 2",
24+
"codingamerHandle": "fedcba9876543210fedcba98765432101234567",
25+
"duration": 0,
26+
"status": "STANDARD",
27+
"rank": 1,
28+
"position": 2
29+
}
30+
],
31+
"programmingLanguages": ["Python3"],
32+
"modes": [
33+
"FASTEST", "SHORTEST"
34+
]
35+
}

tests/mock/responses/get_clash_of_code_from_handle.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"publicHandle": "1234567fedcba9876543210fedcba9876543210",
55
"clashDurationTypeId": "SHORT",
66
"mode": "FASTEST",
7-
"startTimestamp": 1708107395331,
7+
"startTimestamp": 1700000000000,
88
"msBeforeStart": -26220184000,
99
"msBeforeEnd": -26219284000,
1010
"finished": true,

tests/mock/responses/get_clash_of_code_from_handle.started.json

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,42 @@
33
"nbPlayersMax": 100,
44
"publicHandle": "1234567fedcba9876543210fedcba9876543210",
55
"clashDurationTypeId": "SHORT",
6-
"mode": "FASTEST",
7-
"startTimestamp": 1708107395331,
8-
"msBeforeStart": -26220184000,
9-
"msBeforeEnd": -26219284000,
10-
"finished": true,
6+
"mode": "SHORTEST",
7+
"startTimestamp": 1700000000000,
8+
"msBeforeStart": -5000,
9+
"msBeforeEnd": 895000,
10+
"finished": false,
1111
"started": true,
12-
"type": "PUBLIC",
12+
"type": "PRIVATE",
1313
"players": [
1414
{
1515
"codingamerId": 1234567,
1616
"codingamerNickname": "Player 1",
1717
"codingamerHandle": "0123456789abcdef0123456789abcdef7654321",
18-
"score": 100,
19-
"duration": 120,
20-
"status": "STANDARD",
21-
"testSessionStatus": "COMPLETED",
22-
"languageId": "Python3",
18+
"duration": 0,
19+
"status": "OWNER",
20+
"testSessionStatus": "READY",
2321
"rank": 1,
24-
"position": 2,
25-
"solutionShared": true,
26-
"testSessionHandle": "12345678fedcba9876543210fedcba9876543210",
27-
"submissionId": 12345678
22+
"position": 1,
23+
"testSessionHandle": "12345678fedcba9876543210fedcba9876543210"
2824
},
2925
{
3026
"codingamerId": 7654321,
3127
"codingamerNickname": "Player 2",
3228
"codingamerHandle": "fedcba9876543210fedcba98765432101234567",
33-
"score": 100,
34-
"duration": 300,
29+
"duration": 0,
3530
"status": "STANDARD",
36-
"testSessionStatus": "COMPLETED",
37-
"languageId": "Python3",
38-
"rank": 2,
39-
"position": 3,
40-
"solutionShared": true,
41-
"testSessionHandle": "23456789edcba9876543210fedcba9876543210f",
42-
"submissionId": 23456789
43-
},
44-
{
45-
"codingamerId": 3456789,
46-
"codingamerNickname": "Player 3",
47-
"codingamerHandle": "ef0123456789abcdef0123456789abcd9876543",
48-
"codingamerAvatarId": 12345678901234,
49-
"score": 0,
50-
"duration": 240,
51-
"status": "OWNER",
52-
"testSessionStatus": "COMPLETED",
53-
"languageId": "Python3",
54-
"rank": 3,
55-
"position": 1,
56-
"solutionShared": false,
57-
"testSessionHandle": "34567890dcba9876543210fedcba9876543210fe",
58-
"submissionId": 34567890
31+
"testSessionStatus": "READY",
32+
"rank": 1,
33+
"position": 2,
34+
"testSessionHandle": "23456789edcba9876543210fedcba9876543210f"
5935
}
6036
],
61-
"programmingLanguages": ["Python3"],
37+
"programmingLanguages": [
38+
"Python3"
39+
],
6240
"modes": [
63-
"FASTEST", "SHORTEST"
41+
"FASTEST",
42+
"SHORTEST"
6443
]
6544
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)