File: test-cache_invalidation.py

package info (click to toggle)
libfiu 1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 768 kB
  • sloc: ansic: 2,633; python: 973; makefile: 599; sh: 309
file content (21 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
Tests to make sure cache invalidation works.
"""

import fiu

# Unknown - add - fail - remove - not fail.
# The initial unknown is relevant because it places a negative match in the
# cache.
assert not fiu.fail("p1")
fiu.enable("p1")
assert fiu.fail("p1")
fiu.disable("p1")
assert not fiu.fail("p1")

# Same as above, but with wildcards.
assert not fiu.fail("p2/x")
fiu.enable("p2/*")
assert fiu.fail("p2/x")
fiu.disable("p2/*")
assert not fiu.fail("p2/x")