File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1
- VERSION = (0 , 0 , 39 )
1
+ VERSION = (0 , 0 , 40 )
2
2
3
3
__version__ = '.' .join (map (str , VERSION ))
Original file line number Diff line number Diff line change @@ -470,3 +470,29 @@ def test_validated_json_fails_with_invalid_json_str(mock_hub_instance):
470
470
with pytest .raises (JSONDecodeError ) as e_info :
471
471
validated_json = mock_hub_instance ._validated_json_data ('invalid json' )
472
472
473
+ @pytest .fixture ()
474
+ def code_locations (requests_mock , shared_datadir ):
475
+ data = json .load ((shared_datadir / 'code_locations.json' ).open ())
476
+ requests_mock .get (
477
+ "{}/api/codelocations?limit=100" .format (fake_hub_host ),
478
+ json = data
479
+ )
480
+ yield data
481
+
482
+ def test_get_codelocations_all (mock_hub_instance , code_locations ):
483
+ code_locs = mock_hub_instance .get_codelocations ()
484
+
485
+ assert code_locs == code_locations
486
+
487
+ def test_get_codelocations_unmapped (mock_hub_instance , code_locations ):
488
+ code_locs = mock_hub_instance .get_codelocations (unmapped = True )
489
+
490
+ assert code_locs != code_locations
491
+
492
+ expected_data = copy .deepcopy (code_locations )
493
+ expected_data ['items' ] = [cl for cl in code_locations ['items' ] if 'mappedProjectVersion' not in cl ]
494
+ expected_data ['totalCount' ] = len (expected_data ['items' ])
495
+
496
+ assert code_locs == expected_data
497
+
498
+
You can’t perform that action at this time.
0 commit comments