

def test_dependency_refresh(self):
    'This tests a specific behavior of bundle dependencies.\n        If they are specified via glob, then that glob is cached\n        and only refreshed after a build. The thinking is that in\n        those cases for which the depends option was designed, if\n        for example a new SASS include file is created, for this\n        file to be included, one of the existing files first needs\n        to be modified to actually add the include command.\n        '
    updater = self.env.updater = TimestampUpdater()
    self.env.cache = False
    self.create_files({
        'first.sass': 'one',
    })
    b = self.mkbundle('in1', output='out', depends='*.sass')
    b.build()
    now = self.setmtime('in1', 'first.sass', 'out')
    assert (updater.needs_rebuild(b, self.env) == False)
    self.create_files({
        'second.sass': 'two',
    })
    self.setmtime('second.sass', mtime=(now + 100))
    assert (updater.needs_rebuild(b, self.env) == False)
    self.setmtime('first.sass', mtime=(now + 200))
    assert (updater.needs_rebuild(b, self.env) == SKIP_CACHE)
    b.build()
    self.setmtime('out', mtime=(now + 200))
    self.setmtime('second.sass', mtime=(now + 300))
    assert (updater.needs_rebuild(b, self.env) == SKIP_CACHE)

dataset/ETHPy150Open miracle2k/webassets/tests/test_bundle_build.py TestAutoBuild.test_dependency_refresh/original