-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version 1.12.7
- Loading branch information
Showing
13 changed files
with
275 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ python: | |
install: | ||
- method: pip | ||
path: . | ||
requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sphinx-rtd-theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[tool.poetry] | ||
name = "pyobs-core" | ||
packages = [{ include = "pyobs" }] | ||
version = "1.12.6" | ||
version = "1.12.7" | ||
description = "robotic telescope software" | ||
authors = ["Tim-Oliver Husser <[email protected]>"] | ||
license = "MIT" | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from typing import Any, Tuple, Optional | ||
|
||
import pytest | ||
|
||
from pyobs.modules.roof import BaseDome | ||
|
||
|
||
class TestBaseDome(BaseDome): | ||
|
||
async def init(self, **kwargs: Any) -> None: | ||
pass | ||
|
||
async def park(self, **kwargs: Any) -> None: | ||
pass | ||
|
||
async def stop_motion(self, device: Optional[str] = None, **kwargs: Any) -> None: | ||
pass | ||
|
||
async def move_altaz(self, alt: float, az: float, **kwargs: Any) -> None: | ||
pass | ||
|
||
async def get_altaz(self, **kwargs: Any) -> Tuple[float, float]: | ||
return 60.0, 0.0 | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_get_fits_header_before(mocker): | ||
dome = TestBaseDome() | ||
|
||
mocker.patch("pyobs.modules.roof.BaseRoof.get_fits_header_before", return_value={"ROOF-OPN": (True, "")}) | ||
|
||
header = await dome.get_fits_header_before() | ||
|
||
assert "ROOF-OPN" in header | ||
assert header["ROOF-AZ"] == (0.0, "Azimuth of roof slit, deg E of N") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from typing import Optional, Any | ||
from unittest.mock import AsyncMock | ||
|
||
import pytest | ||
|
||
import pyobs | ||
from pyobs.modules.roof import BaseRoof | ||
from pyobs.utils.enums import MotionStatus | ||
|
||
|
||
class TestBaseRoof(BaseRoof): | ||
async def init(self, **kwargs: Any) -> None: | ||
pass | ||
|
||
async def park(self, **kwargs: Any) -> None: | ||
pass | ||
|
||
async def stop_motion(self, device: Optional[str] = None, **kwargs: Any) -> None: | ||
pass | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_open(mocker): | ||
mocker.patch("pyobs.mixins.WeatherAwareMixin.open") | ||
mocker.patch("pyobs.mixins.MotionStatusMixin.open") | ||
mocker.patch("pyobs.modules.Module.open") | ||
|
||
telescope = TestBaseRoof() | ||
await telescope.open() | ||
|
||
pyobs.mixins.WeatherAwareMixin.open.assert_called_once_with(telescope) | ||
pyobs.mixins.MotionStatusMixin.open.assert_called_once_with(telescope) | ||
pyobs.modules.Module.open.assert_called_once_with(telescope) | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_get_fits_header_before_open(): | ||
telescope = TestBaseRoof() | ||
|
||
telescope.get_motion_status = AsyncMock(return_value=MotionStatus.POSITIONED) | ||
header = await telescope.get_fits_header_before() | ||
|
||
assert header["ROOF-OPN"] == (True, "True for open, false for closed roof") | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_get_fits_header_before_closed(): | ||
telescope = TestBaseRoof() | ||
|
||
telescope.get_motion_status = AsyncMock(return_value=MotionStatus.PARKED) | ||
header = await telescope.get_fits_header_before() | ||
|
||
assert header["ROOF-OPN"] == (False, "True for open, false for closed roof") | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_ready(): | ||
telescope = TestBaseRoof() | ||
|
||
telescope.get_motion_status = AsyncMock(return_value=MotionStatus.TRACKING) | ||
assert await telescope.is_ready() is True | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_not_ready(): | ||
telescope = TestBaseRoof() | ||
|
||
telescope.get_motion_status = AsyncMock(return_value=MotionStatus.PARKING) | ||
assert await telescope.is_ready() is False |
Oops, something went wrong.