sot / mica

Microscope on Chandra aspect
https://sot.github.io/mica
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Remove use of Ska.Shell #269

Closed javierggt closed 2 years ago

javierggt commented 2 years ago

Description

Remove uses of Ska.Shell that can be handled with builtin functions.

Interface impacts

None

Testing

Unit tests

Independent check of unit tests by Jean

Functional tests

and then in python:

from mica.report import report
import getpass
import Ska.DBI
from pathlib import Path

user = getpass.getuser()
cwd = Path().absolute()
db = Ska.DBI.DBI(server='sqlsao', dbi='sybase', user=user, database='axafvv')  # as in test_write_reports
report.REPORT_ROOT = str(cwd)
report.REPORT_SERVER = str(cwd / 'test.db3')

for obsid in [20001, 15175, 54778]:
    report.main(obsid)

and check that all image links are there as expected (dir contents are the same as with the latest release and links are not broken).

Also checked that the bash history does not show the older ln -s ... statements.

taldcroft commented 2 years ago

The changes look good on the surface. @jeanconn - do you have any suggestions for how to test this?

jeanconn commented 2 years ago

Sure. The current report writing test really just confirms the report writing code runs without error... I don't think it would catch if an underlying symlink were broken. To explicitly test that, I'd probably just do what test_write_reports is doing, but stop and inspect the outputs before just removing the reports (which is the cleanup at the end of test_write_reports).