Skip to content

Commit

Permalink
test(Fixtures): Added subscriber and TNS fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
tabbott36 committed Jul 19, 2024
1 parent 4e987a6 commit 1dbc345
Showing 1 changed file with 59 additions and 1 deletion.
60 changes: 59 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Testing for VOEvent object."""

import datetime

import pytest

from frbvoe.models.voe import VOEvent
from frbvoe.models.subscriber import Subscriber
from frbvoe.models.tns import TNS


@pytest.fixture
Expand Down Expand Up @@ -44,3 +45,60 @@ def voe():
snr=13.8,
flux=4.9,
)

@pytest.fixture
def subscriber():
"""Generate a Subscriber object for testing.
Returns:
Subscriber: Subscriber object.
"""
return Subscriber(
name="John Smith",
contact_email="[email protected]",
requested_service="xmls",
subscriber_email="[email protected]"
ip_address="123.89.46.72"
)

@pytest.fixture
def tns():
""" Generate a TNS object for testing.
Returns:
TNS: TNS object.
"""
return TNS(
tns_api_key="apikey123",
tns_report_id=123,
tns_bot_name="botname",
kind="detection",
author="John Smith",
email="[email protected]",
coordinate_system="celestial",
right_ascension=55.2938,
declination=14.2049,
localization_error=0.1,
importance=0.9979,
website="https://www.example.com",
backend_url="https://www.example.com/backend",
tns_name="FRB20210826A",
date=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"),
semi_major=0.026,
semi_minor=0.013,
ellipse_error=0.001,
sampling_time=0.001,
bandwidth=400,
central_frequency=600,
npol=2,
bits_per_sample=2,
gain=1.76,
tsys=25.0,
beam_number=2,
dm=298.53,
dm_error=0.01,
width=4.8,
snr=13.8,
flux=4.9,
)

0 comments on commit 1dbc345

Please sign in to comment.