Coverage for middle_layer/propose/application_layer/services/observation_specification.py: 50.00%

10 statements  

« prev     ^ index     » next       coverage.py v7.10.5, created at 2026-03-09 06:13 +0000

1# Copyright 2024 Associated Universities, Inc. 

2# 

3# This file is part of Telescope Time Allocation Tools (TTAT). 

4# 

5# TTAT is free software: you can redistribute it and/or modify 

6# it under the terms of the GNU General Public License as published by 

7# the Free Software Foundation, either version 3 of the License, or 

8# any later version. 

9# 

10# TTAT is distributed in the hope that it will be useful, 

11# but WITHOUT ANY WARRANTY; without even the implied warranty of 

12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

13# GNU General Public License for more details. 

14# 

15# You should have received a copy of the GNU General Public License 

16# along with TTAT. If not, see <https://www.gnu.org/licenses/>. 

17# 

18 

19from pyramid.request import Request 

20 

21from propose.domain_layer.entities.observation_specification import ObservationSpecification 

22from propose.domain_layer.entities.proposal import AllocationRequest 

23from propose.domain_layer.services.observation_specification_generator_service import ( 

24 generate_observation_specifications, 

25) 

26 

27 

28def replace_observation_specifications(ar: AllocationRequest, request: Request) -> list[ObservationSpecification]: 

29 observation_specifications = generate_observation_specifications(ar) 

30 ar.observation_specifications.clear() 

31 for obs_spec in observation_specifications: 

32 ar.observation_specifications.append(obs_spec) 

33 

34 return observation_specifications