@@ -63,15 +63,26 @@ def entity_factory():
63
63
def tmp_epics_root (samples : Path , tmp_path : Path , mocker : MockerFixture ):
64
64
# create an partially populated epics_root structure in a temporary folder
65
65
epics = tmp_path / "epics"
66
+ epics_source = samples / "epics"
66
67
epics .mkdir ()
67
- shutil .copytree (samples / "epics" / "pvi-defs" , epics / "pvi-defs" )
68
- shutil .copytree (samples / "epics" / "support" , epics / "support" )
69
- Path .mkdir (epics / "opi" )
70
- Path .mkdir (epics / "epics-base" )
71
- Path .mkdir (epics / "ioc/config" , parents = True )
72
- Path .mkdir (epics / "ibek-defs" )
73
- Path .mkdir (epics / "runtime" )
74
-
68
+ # a dummy venv for testing extract_assets
69
+ Path .mkdir (tmp_path / "venv" )
70
+
71
+ # create the minimal structure under epics root
72
+ files = epics_source .glob ("*" )
73
+ for f in files :
74
+ if f .is_dir ():
75
+ shutil .copytree (f , epics / f .name )
76
+ else :
77
+ shutil .copy (f , epics / f .name )
78
+ Path .mkdir (epics / "opi" , exist_ok = True )
79
+ Path .mkdir (epics / "epics-base" , exist_ok = True )
80
+ Path .mkdir (epics / "generic-source" / "ioc" / "config" , parents = True )
81
+ (epics / "ioc" ).symlink_to (epics / "generic-source" / "ioc" )
82
+ Path .mkdir (epics / "ibek-defs" , exist_ok = True )
83
+ Path .mkdir (epics / "runtime" , exist_ok = True )
84
+
85
+ # patch the global EPICS_ROOT to point to this temporary folder
75
86
mocker .patch .object (GLOBALS , "_EPICS_ROOT" , epics )
76
87
77
88
# this should not be needed - what gives?
0 commit comments