def setUpClass(cls): """ Sets up a random tree-like structure with a few sub-files and -folders Similar to test_FileSystem. :return: """ os.makedirs(cls.cams_dir) for i in range(cls.n_cams): DummyFiles.CAMSGenerator(cls.cams_dir).generate() for tile in cls.tiles: cls.mnt += [ DummyFiles.MNTGenerator(cls.root, tile=tile).generate() ]
def setUpClass(cls): from Chain import DummyFiles from Common import FileSystem cls.product_root = os.path.join(cls.root, cls.tile) FileSystem.create_directory(cls.product_root) DummyFiles.L1Generator(cls.product_root, tile=cls.tile, date=cls.start_product, platform="sentinel2").generate() DummyFiles.L1Generator(cls.product_root, tile=cls.tile, date=cls.end_product, platform="sentinel2").generate() for d in set([DummyFiles.random_date() for _ in range(cls.n_dummies)]): DummyFiles.L1Generator(cls.product_root, tile=cls.tile, date=d, platform="sentinel2").generate() DummyFiles.L2Generator(cls.product_root, tile=cls.tile, date=d, platform="sentinel2").generate() for d in set([DummyFiles.random_date() for _ in range(cls.n_not_used)]): DummyFiles.L1Generator(cls.product_root, date=d, platform="sentinel2").generate() DummyFiles.L2Generator(cls.product_root, date=d, platform="sentinel2").generate() cls.folders_file = os.path.join(cls.root, "test_working_folders_file.txt") modify_folders_file(cls.template_folders_file, new_file=cls.folders_file, exeMaja=os.getcwd(), repWork=os.getcwd(), repGIPP=os.getcwd(), repL1=os.getcwd(), repL2=os.getcwd(), repMNT=os.getcwd()) cls.mnt = DummyFiles.MNTGenerator(root=cls.root, tile=cls.tile, platform="sentinel2") cls.mnt.generate() cls.cams = os.path.join(cls.root, "CAMS") os.makedirs(cls.cams) DummyFiles.CAMSGenerator(cls.cams, cls.start_product).generate() DummyFiles.CAMSGenerator(cls.cams, cls.end_product).generate() for _ in range(cls.n_not_used): DummyFiles.CAMSGenerator(cls.cams).generate() assert os.path.isfile(cls.folders_file)