def test_get_team(): az = AzDevOps(org='foo', token='bar') project = SimpleNamespace(id=1) result = az._get_team(project, 'foo') assert result.id == 1 assert az._get_team(project, 'something') is None
def test_enable_epics(): az = AzDevOps(org='foo', token='bar') az._get_team = MagicMock( return_value=SimpleNamespace(id=1, project_id=1, name='foo')) project = SimpleNamespace(id=1) az._enable_epics(project, 'foo') assert az.clients.get_work_client.return_value.update_team_settings.called_with( { "backlogVisibilities": { "Microsoft.EpicCategory": 'true', "Microsoft.FeatureCategory": 'true', "Microsoft.RequirementCategory": 'true' } }, SimpleNamespace(team_id=1, project_id=1))