Coverage for python/lsst/resources/mem.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-04-09 09:05 +0000

1# This file is part of lsst-resources. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# Use of this source code is governed by a 3-clause BSD-style 

10# license that can be found in the LICENSE file. 

11 

12from typing import Tuple 

13 

14__all__ = ("InMemoryResourcePath",) 

15 

16from ._resourcePath import ResourcePath 

17 

18 

19class InMemoryResourcePath(ResourcePath): 

20 """Internal in-memory datastore URI (`mem://`). 

21 

22 Not used for any real purpose other than indicating that the dataset 

23 is in memory. 

24 """ 

25 

26 def exists(self) -> bool: 

27 """Test for existence and always return False.""" 

28 return True 

29 

30 def _as_local(self) -> Tuple[str, bool]: 

31 raise RuntimeError(f"Do not know how to retrieve data for URI '{self}'")