def _buildSibtCall(self): return [ relativeToProjectRoot("sibt/sibt"), "--config-dir", self.paths.configDir, "--var-dir", self.paths.varDir, "--readonly-dir", self.paths.readonlyDir, "--no-sys-config", "--utc" ]
def useActualSibtConfig(self): for dest in [ self.paths.readonlySchedulersDir, self.paths.readonlySynchronizersDir, self.paths.runnersDir ]: shutil.copytree( relativeToProjectRoot("sibt/" + os.path.basename(dest)), dest)
def test_shouldCorrectlyReanchorExcludedDirs(self, funcFixture): assert funcFixture.compute(""" source '{0}' /dev/null '' declare -a ExcludedDirs=(/mnt/data) declare -a result=() -get-reanchored-exclude-opts mnt 1 result echo -n "${result[1]}" """.replace( "{0}", relativeToProjectRoot("sibt/runners/bash-runner"))) == b"/data/"
def loadModule(schedulerName, varDir, sibtCall=["/where/sibt/is"], logger=None, clock=None): global testPackageCounter testPackageCounter = testPackageCounter + 1 packageName = "testpackage{0}".format(testPackageCounter) loader = PyModuleSchedulerLoader(PyModuleLoader(packageName)) modulePath = relativeToProjectRoot( os.path.join("sibt", "schedulers", schedulerName)) return configrepo.loadSchedulerFromModule( loader, modulePath, schedulerName, configrepo.SchedulerArgs(sibtCall, str(varDir), logger, clock))
def load(self, synchronizerName): path = relativeToProjectRoot("sibt/synchronizers/" + synchronizerName) self.syncer = loadSynchronizer(path) self.loc1 = self.tmpdir.mkdir("Loc $1\"\\'") self.loc2 = self.tmpdir.mkdir("Loc $2\"\\'")
def bashFuncFixture(): return BashFuncTestFixture( relativeToProjectRoot("sibt/runners/bash-runner"), "/dev/null ''")
def funcFixture(): return BashFuncTestFixture( relativeToProjectRoot("sibt/synchronizers/rsync"))
def __init__(self, tmpdir): super().__init__(relativeToProjectRoot("sibt/synchronizers/tar")) self.snapshotFile = tmpdir / "snapshot"
def __init__(self, tmpdir): super().__init__(relativeToProjectRoot("sibt/synchronizers/duplicity"))
def loadSynchronizer(absolutePath): processRunner = configrepo.createHashbangAwareProcessRunner( relativeToProjectRoot("sibt/runners"), CoprocessRunner()) return configrepo.loadSynchronizer(processRunner, absolutePath, os.path.basename(absolutePath))