diff options
Diffstat (limited to 'tests/frontend')
5 files changed, 11 insertions, 2 deletions
diff --git a/tests/frontend/consistencyerror/bug.bst b/tests/frontend/consistencyerror/bug.bst index a66002046..5639abee2 100644 --- a/tests/frontend/consistencyerror/bug.bst +++ b/tests/frontend/consistencyerror/bug.bst @@ -1,4 +1,4 @@ kind: import -description: An element with an unhandled exception at get_consistency time +description: An element with an unhandled exception in checking whether it is cached or not sources: - kind: consistencybug diff --git a/tests/frontend/consistencyerror/error.bst b/tests/frontend/consistencyerror/error.bst index ccf11c942..e377aa97a 100644 --- a/tests/frontend/consistencyerror/error.bst +++ b/tests/frontend/consistencyerror/error.bst @@ -1,4 +1,4 @@ kind: import -description: An element with a failing source at get_consistency time +description: An element with a failing source when checking whether it is cached or not sources: - kind: consistencyerror diff --git a/tests/frontend/consistencyerror/plugins/consistencybug.py b/tests/frontend/consistencyerror/plugins/consistencybug.py index c4a3217ec..7f0bd9211 100644 --- a/tests/frontend/consistencyerror/plugins/consistencybug.py +++ b/tests/frontend/consistencyerror/plugins/consistencybug.py @@ -14,6 +14,9 @@ class ConsistencyBugSource(Source): def is_resolved(self): return True + def is_cached(self): + return True + def get_consistency(self): # Raise an unhandled exception (not a BstError) diff --git a/tests/frontend/consistencyerror/plugins/consistencyerror.py b/tests/frontend/consistencyerror/plugins/consistencyerror.py index d7433e368..523ac0b6f 100644 --- a/tests/frontend/consistencyerror/plugins/consistencyerror.py +++ b/tests/frontend/consistencyerror/plugins/consistencyerror.py @@ -14,6 +14,9 @@ class ConsistencyErrorSource(Source): def is_resolved(self): return True + def is_cached(self): + return True + def get_consistency(self): # Raise an error unconditionally diff --git a/tests/frontend/project/sources/fetch_source.py b/tests/frontend/project/sources/fetch_source.py index d634adfa3..60b4ba95d 100644 --- a/tests/frontend/project/sources/fetch_source.py +++ b/tests/frontend/project/sources/fetch_source.py @@ -69,6 +69,9 @@ class FetchSource(Source): def is_resolved(self): return True + def is_cached(self) -> bool: + return self.get_consistency() == Consistency.CACHED + def get_consistency(self): if not os.path.exists(self.output_file): return Consistency.RESOLVED |