@@ -0,0 +1,853 @@
+import os%0Aimport tempfile%0Afrom Chandra.Time import DateTime%0Afrom Ska.Shell import bash%0Aimport mica.common%0A%0A# Override MICA_ARCHIVE with a temporary directory%0ATESTDIR = tempfile.mkdtemp()%0Amica.common.MICA_ARCHIVE = TESTDIR%0A# import mica.starcheck.starcheck after setting MICA_ARCHIVE%0Aimport mica.starcheck.starcheck%0A%0A# Just ingest files from the last couple of weeks or so%0A# This still uses the silly find files newer than this other file method, so%0A# set the time stamp on that reference file%0Aif not os.path.exists(os.path.join(TESTDIR, 'starcheck')):%0A    os.makedirs(os.path.join(TESTDIR, 'starcheck'))%0Abash(%22touch -d %7B%7D %7B%7D%22.format(DateTime(-15).iso, mica.starcheck.starcheck.FILES%5B'touch_file'%5D))%0A# And just check that the update script didn't raise any exceptions%0Amica.starcheck.starcheck.update()%0A# Cleanup manually%0Abash(%22rm -r %7B%7D%22.format(TESTDIR))%0A

Add a script to make a test starcheck database from recent data