Coverage for tests/test_mem.py: 53%
15 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-07-12 10:52 -0700
« prev ^ index » next coverage.py v7.2.7, created at 2023-07-12 10:52 -0700
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.
12import unittest
14from lsst.resources import ResourcePath
15from lsst.resources.tests import GenericTestCase
18class MemoryTestCase(GenericTestCase, unittest.TestCase):
19 """Generic tests of the mem URI."""
21 scheme = "mem"
22 netloc = "unknown"
25class MemoryReadTestCase(unittest.TestCase):
26 """Simple tests of I/O with mem URI."""
28 def setUp(self):
29 self.root_uri = ResourcePath("mem://x/y.z")
31 def test_exists(self):
32 """Always exist."""
33 self.assertTrue(self.root_uri.exists())
35 def test_local(self):
36 with self.assertRaises(RuntimeError):
37 with self.root_uri.as_local():
38 pass
41if __name__ == "__main__":
42 unittest.main()