@@ -197,6 +197,7 @@ def test_updates_simple_properties(self, mock_api_constructor: MagicMock, *args,
197197 "name" : "Test Challenge" ,
198198 "category" : "New Test" ,
199199 "description" : "New Test Description" ,
200+ "attribution" : "New Test Attribution" ,
200201 "type" : "standard" ,
201202 "value" : 150 ,
202203 "state" : "hidden" ,
@@ -239,6 +240,7 @@ def test_updates_attempts(self, mock_api_constructor: MagicMock, *args, **kwargs
239240 "name" : "Test Challenge" ,
240241 "category" : "New Test" ,
241242 "description" : "New Test Description" ,
243+ "attribution" : "New Test Attribution" ,
242244 "type" : "standard" ,
243245 "value" : 150 ,
244246 "state" : "hidden" ,
@@ -284,6 +286,7 @@ def test_updates_extra_properties(self, mock_api_constructor: MagicMock, *args,
284286 "name" : "Test Challenge" ,
285287 "category" : "New Test" ,
286288 "description" : "New Test Description" ,
289+ "attribution" : "New Test Attribution" ,
287290 "value" : 150 ,
288291 "state" : "hidden" ,
289292 "type" : "application_target" ,
@@ -342,6 +345,7 @@ def test_updates_flags(self, mock_api_constructor: MagicMock, *args, **kwargs):
342345 "name" : "Test Challenge" ,
343346 "category" : "New Test" ,
344347 "description" : "New Test Description" ,
348+ "attribution" : "New Test Attribution" ,
345349 "type" : "standard" ,
346350 "value" : 150 ,
347351 "state" : "hidden" ,
@@ -430,6 +434,7 @@ def test_updates_topics(self, mock_api_constructor: MagicMock, *args, **kwargs):
430434 "name" : "Test Challenge" ,
431435 "category" : "New Test" ,
432436 "description" : "New Test Description" ,
437+ "attribution" : "New Test Attribution" ,
433438 "type" : "standard" ,
434439 "value" : 150 ,
435440 "state" : "hidden" ,
@@ -490,6 +495,7 @@ def test_updates_tags(self, mock_api_constructor: MagicMock, *args, **kwargs):
490495 "name" : "Test Challenge" ,
491496 "category" : "New Test" ,
492497 "description" : "New Test Description" ,
498+ "attribution" : "New Test Attribution" ,
493499 "type" : "standard" ,
494500 "value" : 150 ,
495501 "state" : "hidden" ,
@@ -553,6 +559,7 @@ def test_updates_files(self, mock_api_constructor: MagicMock, *args, **kwargs):
553559 "name" : "Test Challenge" ,
554560 "category" : "New Test" ,
555561 "description" : "New Test Description" ,
562+ "attribution" : "New Test Attribution" ,
556563 "type" : "standard" ,
557564 "value" : 150 ,
558565 "state" : "hidden" ,
@@ -654,6 +661,7 @@ def test_updates_hints(self, mock_api_constructor: MagicMock, *args, **kwargs):
654661 "name" : "Test Challenge" ,
655662 "category" : "New Test" ,
656663 "description" : "New Test Description" ,
664+ "attribution" : "New Test Attribution" ,
657665 "type" : "standard" ,
658666 "value" : 150 ,
659667 "state" : "hidden" ,
@@ -714,6 +722,7 @@ def test_updates_requirements(self, mock_api_constructor: MagicMock, *args, **kw
714722 "name" : "Test Challenge" ,
715723 "category" : "New Test" ,
716724 "description" : "New Test Description" ,
725+ "attribution" : "New Test Attribution" ,
717726 "type" : "standard" ,
718727 "value" : 150 ,
719728 "state" : "hidden" ,
@@ -756,6 +765,7 @@ def test_challenge_cannot_require_itself(
756765 "name" : "Test Challenge" ,
757766 "category" : "New Test" ,
758767 "description" : "New Test Description" ,
768+ "attribution" : "New Test Attribution" ,
759769 "type" : "standard" ,
760770 "value" : 150 ,
761771 "state" : "hidden" ,
@@ -816,6 +826,7 @@ def test_defaults_to_standard_challenge_type(self, mock_api_constructor: MagicMo
816826 "name" : "Test Challenge" ,
817827 "category" : "New Test" ,
818828 "description" : "New Test Description" ,
829+ "attribution" : "New Test Attribution" ,
819830 "type" : "standard" ,
820831 "value" : 150 ,
821832 "state" : "hidden" ,
@@ -854,6 +865,7 @@ def test_defaults_to_visible_state(self, mock_api_constructor: MagicMock, *args,
854865 "name" : "Test Challenge" ,
855866 "category" : "New Test" ,
856867 "description" : "New Test Description" ,
868+ "attribution" : "New Test Attribution" ,
857869 "type" : "standard" ,
858870 "value" : 150 ,
859871 "max_attempts" : 0 ,
@@ -904,6 +916,7 @@ def test_does_not_update_dynamic_value(self, mock_api_constructor: MagicMock, *a
904916 "name" : "Test Challenge" ,
905917 "category" : "New Test" ,
906918 "description" : "New Test Description" ,
919+ "attribution" : "New Test Attribution" ,
907920 "type" : "dynamic" ,
908921 "state" : "hidden" ,
909922 "max_attempts" : 0 ,
@@ -961,6 +974,7 @@ def test_updates_multiple_attributes_at_once(self, mock_api_constructor: MagicMo
961974 "name" : "Test Challenge" ,
962975 "category" : "New Test" ,
963976 "description" : "New Test Description" ,
977+ "attribution" : "New Test Attribution" ,
964978 "type" : "standard" ,
965979 "value" : 150 ,
966980 "state" : "hidden" ,
@@ -1018,7 +1032,7 @@ def test_does_not_update_ignored_attributes(self):
10181032 properties = [
10191033 # fmt: off
10201034 # simple types
1021- "category" , "description" , "type" , "value" , "attempts" , "connection_info" , "state" ,
1035+ "category" , "description" , "attribution" , " type" , "value" , "attempts" , "connection_info" , "state" ,
10221036 # complex types
10231037 "extra" , "flags" , "topics" , "tags" , "files" , "hints" , "requirements" ,
10241038 # fmt: on
@@ -1028,6 +1042,7 @@ def test_does_not_update_ignored_attributes(self):
10281042 "name" : "Test Challenge" ,
10291043 "category" : "Old Category" ,
10301044 "description" : "Old Description" ,
1045+ "attribution" : "Old Attribution" ,
10311046 "type" : "some-custom-type" ,
10321047 "value" : 100 ,
10331048 "state" : "visible" ,
@@ -1057,6 +1072,7 @@ def test_does_not_update_ignored_attributes(self):
10571072 "name" : "Test Challenge" ,
10581073 "category" : "New Test" ,
10591074 "description" : "New Test Description" ,
1075+ "attribution" : "New Test Attribution" ,
10601076 "type" : "standard" ,
10611077 "value" : 150 ,
10621078 "state" : "hidden" ,
@@ -1072,7 +1088,7 @@ def test_does_not_update_ignored_attributes(self):
10721088 expected_challenge_payload ["value" ] = remote_installed_challenge ["value" ]
10731089 challenge ["value" ] = 200
10741090
1075- if p in ["category" , "description" , "type" ]:
1091+ if p in ["category" , "description" , "attribution" , " type" ]:
10761092 expected_challenge_payload [p ] = remote_installed_challenge [p ]
10771093 challenge [p ] = "new-value"
10781094
@@ -1154,6 +1170,7 @@ def test_creates_standard_challenge(self, mock_api_constructor: MagicMock, *args
11541170 "name" : "Test Challenge" ,
11551171 "category" : "Test" ,
11561172 "description" : "Test Description" ,
1173+ "attribution" : "Test Attribution" ,
11571174 "value" : 150 ,
11581175 "max_attempts" : 5 ,
11591176 "type" : "standard" ,
@@ -1244,7 +1261,7 @@ def test_exits_if_files_do_not_exist(self, mock_api_constructor: MagicMock, *arg
12441261 def test_does_not_set_ignored_attributes (self ):
12451262 # fmt:off
12461263 properties = [
1247- "value" , "category" , "description" , "attempts" , "connection_info" , "state" , # simple types
1264+ "value" , "category" , "description" , "attribution" , " attempts" , "connection_info" , "state" , # simple types
12481265 "extra" , "flags" , "topics" , "tags" , "files" , "hints" , "requirements" # complex types
12491266 ]
12501267 # fmt:on
@@ -1262,6 +1279,7 @@ def test_does_not_set_ignored_attributes(self):
12621279 "name" : "Test Challenge" ,
12631280 "category" : "New Test" ,
12641281 "description" : "New Test Description" ,
1282+ "attribution" : "New Test Attribution" ,
12651283 "type" : "standard" ,
12661284 "value" : 150 ,
12671285 "state" : "hidden" ,
@@ -1282,7 +1300,7 @@ def test_does_not_set_ignored_attributes(self):
12821300 expected_challenge_payload [p ] = "custom-type"
12831301
12841302 # 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" ]:
12861304 challenge [p ] = "new-value"
12871305 expected_challenge_payload [p ] = ""
12881306
@@ -1520,6 +1538,7 @@ def mock_get(self, *args, **kwargs):
15201538 "name" : "Test Challenge" ,
15211539 "value" : 150 ,
15221540 "description" : "Test Description" ,
1541+ "attribution" : "Test Attribution" ,
15231542 "connection_info" : "https://example.com" ,
15241543 "next_id" : None ,
15251544 "category" : "Test" ,
@@ -1681,6 +1700,7 @@ def test_normalize_fetches_and_normalizes_challenge(self, mock_api_constructor:
16811700 "name" : "Test Challenge" ,
16821701 "category" : "Test" ,
16831702 "description" : "Test Description" ,
1703+ "attribution" : "Test Attribution" ,
16841704 "value" : 150 ,
16851705 "max_attempts" : 5 ,
16861706 "type" : "standard" ,
@@ -1703,6 +1723,7 @@ def test_normalize_fetches_and_normalizes_challenge(self, mock_api_constructor:
17031723 "state" : "hidden" ,
17041724 "connection_info" : "https://example.com" ,
17051725 "description" : "Test Description" ,
1726+ "attribution" : "Test Attribution" ,
17061727 "attempts" : 5 ,
17071728 "flags" : [
17081729 "flag{test-flag}" ,
@@ -1755,6 +1776,7 @@ def test_mirror_challenge(self, mock_api_constructor: MagicMock):
17551776 {
17561777 "value" : 200 ,
17571778 "description" : "other description" ,
1779+ "attribution" : "other attribution" ,
17581780 "connection_info" : "https://other.example.com" ,
17591781 "flags" : ["flag{other-flag}" , "other-flag" ],
17601782 "topics" : ["other-topic-1" , "other-topic-2" ],
0 commit comments