def testDirectoryObsPattern(): s = Scraper('%y%m%d/{observatory}_%Y%m%d.fits', observatory='SDO') testpath = '140305/SDO_20140305.fits' d = parse_time((2014, 3, 5)) assert s.matches(testpath, d)
def testDirectoryDatePatternFalse(): s = Scraper('%Y/%m/%d/%Y%m%d_%H%M%S_59.fit.gz') testpath = '2013/03/05/20140305_013000_59.fit.gz' d = parse_time((2014, 3, 5, 1, 30)) assert not s.matches(testpath, d)