Skip to content

Commit

Permalink
test workign - postgress working localy
Browse files Browse the repository at this point in the history
  • Loading branch information
womullan committed Dec 24, 2023
1 parent 9216afa commit 80f5e96
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/obsloctap/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ async def get_schedule(self, time: float = 0) -> list[Obsplan]:
obs.s_ra = 90.90909091666666
obs.s_dec = -74.60384434722222
obs.rubin_rot_sky_pos = 18.33895879413964
obs.rubin_nexpnexp = 3
obs.rubin_nexp = 3
observations.append(obs)
return observations

Expand Down
5 changes: 3 additions & 2 deletions tests/DbTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ async def test_insert() -> None:
return

plan = Obsplan()
plan.t_planning = Timestamp.now().to_julian_date()
now: float = Timestamp.now().to_julian_date()
plan.t_planning = now
plan.s_ra = 90.90909091666666
plan.s_dec = -74.60384434722222
plan.rubin_nexp = 3
Expand Down Expand Up @@ -47,7 +48,7 @@ async def test_insert() -> None:
# now get it back
plans = await dbhelp.get_schedule(time=100)

await dbhelp.tidyup(plan.t_planning)
await dbhelp.tidyup(now)

assert len(plans) >= 1

Expand Down
8 changes: 4 additions & 4 deletions tests/handlers/external_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ async def test_get_exernal_index(client: AsyncClient) -> None:

@pytest.mark.asyncio
async def test_get_schedule(client: AsyncClient) -> None:
"""will use mock efd for local esting"""
"""will use mock for local esting"""
response = await client.get(f"{config.path_prefix}/schedule")
assert response.status_code == 200
data = response.json()
assert len(data) >= 1
obs = data[0]
assert "nexp" in obs
assert "mjd" in obs
assert data[0]["mjd"] == "60032.194918981484"
assert "rubin_nexp" in obs
assert "t_planning" in obs
assert data[0]["t_planning"] == 60032.194918981484
2 changes: 1 addition & 1 deletion tests/handlers/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ async def test_get_schedule(client: AsyncClient) -> None:
data = response.json()
assert len(data) >= 1
obs = data[0]
assert "nexp" in obs
assert "rubin_nexp" in obs

0 comments on commit 80f5e96

Please sign in to comment.