@@ -197,6 +197,7 @@ def test_updates_simple_properties(self, mock_api_constructor: MagicMock, *args,
197
197
"name" : "Test Challenge" ,
198
198
"category" : "New Test" ,
199
199
"description" : "New Test Description" ,
200
+ "attribution" : "New Test Attribution" ,
200
201
"type" : "standard" ,
201
202
"value" : 150 ,
202
203
"state" : "hidden" ,
@@ -239,6 +240,7 @@ def test_updates_attempts(self, mock_api_constructor: MagicMock, *args, **kwargs
239
240
"name" : "Test Challenge" ,
240
241
"category" : "New Test" ,
241
242
"description" : "New Test Description" ,
243
+ "attribution" : "New Test Attribution" ,
242
244
"type" : "standard" ,
243
245
"value" : 150 ,
244
246
"state" : "hidden" ,
@@ -284,6 +286,7 @@ def test_updates_extra_properties(self, mock_api_constructor: MagicMock, *args,
284
286
"name" : "Test Challenge" ,
285
287
"category" : "New Test" ,
286
288
"description" : "New Test Description" ,
289
+ "attribution" : "New Test Attribution" ,
287
290
"value" : 150 ,
288
291
"state" : "hidden" ,
289
292
"type" : "application_target" ,
@@ -342,6 +345,7 @@ def test_updates_flags(self, mock_api_constructor: MagicMock, *args, **kwargs):
342
345
"name" : "Test Challenge" ,
343
346
"category" : "New Test" ,
344
347
"description" : "New Test Description" ,
348
+ "attribution" : "New Test Attribution" ,
345
349
"type" : "standard" ,
346
350
"value" : 150 ,
347
351
"state" : "hidden" ,
@@ -430,6 +434,7 @@ def test_updates_topics(self, mock_api_constructor: MagicMock, *args, **kwargs):
430
434
"name" : "Test Challenge" ,
431
435
"category" : "New Test" ,
432
436
"description" : "New Test Description" ,
437
+ "attribution" : "New Test Attribution" ,
433
438
"type" : "standard" ,
434
439
"value" : 150 ,
435
440
"state" : "hidden" ,
@@ -490,6 +495,7 @@ def test_updates_tags(self, mock_api_constructor: MagicMock, *args, **kwargs):
490
495
"name" : "Test Challenge" ,
491
496
"category" : "New Test" ,
492
497
"description" : "New Test Description" ,
498
+ "attribution" : "New Test Attribution" ,
493
499
"type" : "standard" ,
494
500
"value" : 150 ,
495
501
"state" : "hidden" ,
@@ -553,6 +559,7 @@ def test_updates_files(self, mock_api_constructor: MagicMock, *args, **kwargs):
553
559
"name" : "Test Challenge" ,
554
560
"category" : "New Test" ,
555
561
"description" : "New Test Description" ,
562
+ "attribution" : "New Test Attribution" ,
556
563
"type" : "standard" ,
557
564
"value" : 150 ,
558
565
"state" : "hidden" ,
@@ -654,6 +661,7 @@ def test_updates_hints(self, mock_api_constructor: MagicMock, *args, **kwargs):
654
661
"name" : "Test Challenge" ,
655
662
"category" : "New Test" ,
656
663
"description" : "New Test Description" ,
664
+ "attribution" : "New Test Attribution" ,
657
665
"type" : "standard" ,
658
666
"value" : 150 ,
659
667
"state" : "hidden" ,
@@ -714,6 +722,7 @@ def test_updates_requirements(self, mock_api_constructor: MagicMock, *args, **kw
714
722
"name" : "Test Challenge" ,
715
723
"category" : "New Test" ,
716
724
"description" : "New Test Description" ,
725
+ "attribution" : "New Test Attribution" ,
717
726
"type" : "standard" ,
718
727
"value" : 150 ,
719
728
"state" : "hidden" ,
@@ -756,6 +765,7 @@ def test_challenge_cannot_require_itself(
756
765
"name" : "Test Challenge" ,
757
766
"category" : "New Test" ,
758
767
"description" : "New Test Description" ,
768
+ "attribution" : "New Test Attribution" ,
759
769
"type" : "standard" ,
760
770
"value" : 150 ,
761
771
"state" : "hidden" ,
@@ -816,6 +826,7 @@ def test_defaults_to_standard_challenge_type(self, mock_api_constructor: MagicMo
816
826
"name" : "Test Challenge" ,
817
827
"category" : "New Test" ,
818
828
"description" : "New Test Description" ,
829
+ "attribution" : "New Test Attribution" ,
819
830
"type" : "standard" ,
820
831
"value" : 150 ,
821
832
"state" : "hidden" ,
@@ -854,6 +865,7 @@ def test_defaults_to_visible_state(self, mock_api_constructor: MagicMock, *args,
854
865
"name" : "Test Challenge" ,
855
866
"category" : "New Test" ,
856
867
"description" : "New Test Description" ,
868
+ "attribution" : "New Test Attribution" ,
857
869
"type" : "standard" ,
858
870
"value" : 150 ,
859
871
"max_attempts" : 0 ,
@@ -904,6 +916,7 @@ def test_does_not_update_dynamic_value(self, mock_api_constructor: MagicMock, *a
904
916
"name" : "Test Challenge" ,
905
917
"category" : "New Test" ,
906
918
"description" : "New Test Description" ,
919
+ "attribution" : "New Test Attribution" ,
907
920
"type" : "dynamic" ,
908
921
"state" : "hidden" ,
909
922
"max_attempts" : 0 ,
@@ -961,6 +974,7 @@ def test_updates_multiple_attributes_at_once(self, mock_api_constructor: MagicMo
961
974
"name" : "Test Challenge" ,
962
975
"category" : "New Test" ,
963
976
"description" : "New Test Description" ,
977
+ "attribution" : "New Test Attribution" ,
964
978
"type" : "standard" ,
965
979
"value" : 150 ,
966
980
"state" : "hidden" ,
@@ -1018,7 +1032,7 @@ def test_does_not_update_ignored_attributes(self):
1018
1032
properties = [
1019
1033
# fmt: off
1020
1034
# simple types
1021
- "category" , "description" , "type" , "value" , "attempts" , "connection_info" , "state" ,
1035
+ "category" , "description" , "attribution" , " type" , "value" , "attempts" , "connection_info" , "state" ,
1022
1036
# complex types
1023
1037
"extra" , "flags" , "topics" , "tags" , "files" , "hints" , "requirements" ,
1024
1038
# fmt: on
@@ -1028,6 +1042,7 @@ def test_does_not_update_ignored_attributes(self):
1028
1042
"name" : "Test Challenge" ,
1029
1043
"category" : "Old Category" ,
1030
1044
"description" : "Old Description" ,
1045
+ "attribution" : "Old Attribution" ,
1031
1046
"type" : "some-custom-type" ,
1032
1047
"value" : 100 ,
1033
1048
"state" : "visible" ,
@@ -1057,6 +1072,7 @@ def test_does_not_update_ignored_attributes(self):
1057
1072
"name" : "Test Challenge" ,
1058
1073
"category" : "New Test" ,
1059
1074
"description" : "New Test Description" ,
1075
+ "attribution" : "New Test Attribution" ,
1060
1076
"type" : "standard" ,
1061
1077
"value" : 150 ,
1062
1078
"state" : "hidden" ,
@@ -1072,7 +1088,7 @@ def test_does_not_update_ignored_attributes(self):
1072
1088
expected_challenge_payload ["value" ] = remote_installed_challenge ["value" ]
1073
1089
challenge ["value" ] = 200
1074
1090
1075
- if p in ["category" , "description" , "type" ]:
1091
+ if p in ["category" , "description" , "attribution" , " type" ]:
1076
1092
expected_challenge_payload [p ] = remote_installed_challenge [p ]
1077
1093
challenge [p ] = "new-value"
1078
1094
@@ -1154,6 +1170,7 @@ def test_creates_standard_challenge(self, mock_api_constructor: MagicMock, *args
1154
1170
"name" : "Test Challenge" ,
1155
1171
"category" : "Test" ,
1156
1172
"description" : "Test Description" ,
1173
+ "attribution" : "Test Attribution" ,
1157
1174
"value" : 150 ,
1158
1175
"max_attempts" : 5 ,
1159
1176
"type" : "standard" ,
@@ -1244,7 +1261,7 @@ def test_exits_if_files_do_not_exist(self, mock_api_constructor: MagicMock, *arg
1244
1261
def test_does_not_set_ignored_attributes (self ):
1245
1262
# fmt:off
1246
1263
properties = [
1247
- "value" , "category" , "description" , "attempts" , "connection_info" , "state" , # simple types
1264
+ "value" , "category" , "description" , "attribution" , " attempts" , "connection_info" , "state" , # simple types
1248
1265
"extra" , "flags" , "topics" , "tags" , "files" , "hints" , "requirements" # complex types
1249
1266
]
1250
1267
# fmt:on
@@ -1262,6 +1279,7 @@ def test_does_not_set_ignored_attributes(self):
1262
1279
"name" : "Test Challenge" ,
1263
1280
"category" : "New Test" ,
1264
1281
"description" : "New Test Description" ,
1282
+ "attribution" : "New Test Attribution" ,
1265
1283
"type" : "standard" ,
1266
1284
"value" : 150 ,
1267
1285
"state" : "hidden" ,
@@ -1282,7 +1300,7 @@ def test_does_not_set_ignored_attributes(self):
1282
1300
expected_challenge_payload [p ] = "custom-type"
1283
1301
1284
1302
# expect these to be in the payload, with the defaults or empty:
1285
- if p in ["category" , "description" ]:
1303
+ if p in ["category" , "description" , "attribution" ]:
1286
1304
challenge [p ] = "new-value"
1287
1305
expected_challenge_payload [p ] = ""
1288
1306
@@ -1520,6 +1538,7 @@ def mock_get(self, *args, **kwargs):
1520
1538
"name" : "Test Challenge" ,
1521
1539
"value" : 150 ,
1522
1540
"description" : "Test Description" ,
1541
+ "attribution" : "Test Attribution" ,
1523
1542
"connection_info" : "https://example.com" ,
1524
1543
"next_id" : None ,
1525
1544
"category" : "Test" ,
@@ -1681,6 +1700,7 @@ def test_normalize_fetches_and_normalizes_challenge(self, mock_api_constructor:
1681
1700
"name" : "Test Challenge" ,
1682
1701
"category" : "Test" ,
1683
1702
"description" : "Test Description" ,
1703
+ "attribution" : "Test Attribution" ,
1684
1704
"value" : 150 ,
1685
1705
"max_attempts" : 5 ,
1686
1706
"type" : "standard" ,
@@ -1703,6 +1723,7 @@ def test_normalize_fetches_and_normalizes_challenge(self, mock_api_constructor:
1703
1723
"state" : "hidden" ,
1704
1724
"connection_info" : "https://example.com" ,
1705
1725
"description" : "Test Description" ,
1726
+ "attribution" : "Test Attribution" ,
1706
1727
"attempts" : 5 ,
1707
1728
"flags" : [
1708
1729
"flag{test-flag}" ,
@@ -1755,6 +1776,7 @@ def test_mirror_challenge(self, mock_api_constructor: MagicMock):
1755
1776
{
1756
1777
"value" : 200 ,
1757
1778
"description" : "other description" ,
1779
+ "attribution" : "other attribution" ,
1758
1780
"connection_info" : "https://other.example.com" ,
1759
1781
"flags" : ["flag{other-flag}" , "other-flag" ],
1760
1782
"topics" : ["other-topic-1" , "other-topic-2" ],
0 commit comments