forked from nasa-gcn/gcn.nasa.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nasa-gcn#1878 from jak574/across-api-ephem-unit-tests
ACROSS API: Add unit tests for Ephemeris calculations and others
- Loading branch information
Showing
13 changed files
with
578 additions
and
7 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
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
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,28 @@ | ||
# Copyright © 2023 United States Government as represented by the | ||
# Administrator of the National Aeronautics and Space Administration. | ||
# All Rights Reserved. | ||
|
||
import pytest | ||
|
||
|
||
class ExpectedResolve: | ||
def __init__(self, name: str, ra: float, dec: float, resolver: str): | ||
self.name = name | ||
self.ra = ra | ||
self.dec = dec | ||
self.resolver = resolver | ||
|
||
|
||
@pytest.fixture | ||
def expected_resolve_crab(): | ||
return ExpectedResolve(name="Crab", ra=83.6287, dec=22.0147, resolver="CDS") | ||
|
||
|
||
@pytest.fixture | ||
def expected_resolve_ztf(): | ||
return ExpectedResolve( | ||
name="ZTF17aabwgbz", | ||
ra=95.85514670221599, | ||
dec=-12.322666705084146, | ||
resolver="ANTARES", | ||
) |
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,19 @@ | ||
# Copyright © 2023 United States Government as represented by the | ||
# Administrator of the National Aeronautics and Space Administration. | ||
# All Rights Reserved. | ||
|
||
from across_api.across.resolve import Resolve | ||
|
||
|
||
def test_resolve_cds(expected_resolve_crab): | ||
resolve = Resolve(expected_resolve_crab.name) | ||
assert abs(resolve.ra - expected_resolve_crab.ra) < 0.1 / 3600 | ||
assert abs(resolve.dec - expected_resolve_crab.dec) < 0.1 / 3600 | ||
assert resolve.resolver == expected_resolve_crab.resolver | ||
|
||
|
||
def test_resolve_antares(expected_resolve_ztf): | ||
resolve = Resolve(expected_resolve_ztf.name) | ||
assert abs(resolve.ra - expected_resolve_ztf.ra) < 0.1 / 3600 | ||
assert abs(resolve.dec - expected_resolve_ztf.dec) < 0.1 / 3600 | ||
assert resolve.resolver == expected_resolve_ztf.resolver |
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
Empty file.
Oops, something went wrong.