From 068b3651c16916877eb8d5fdfec52485a507e204 Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Mon, 31 Oct 2022 13:05:31 +0100 Subject: path and stat readers --- test/reader/test_stat.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/reader/test_stat.py (limited to 'test/reader/test_stat.py') diff --git a/test/reader/test_stat.py b/test/reader/test_stat.py new file mode 100644 index 0000000..d12ad9c --- /dev/null +++ b/test/reader/test_stat.py @@ -0,0 +1,34 @@ +""" + +Part of the bsie test suite. +A copy of the license is provided with the project. +Author: Matthias Baumgartner, 2022 +""" +# imports +import os +import unittest + +# bsie imports +from bsie.base import errors + +# objects to test +from bsie.reader.stat import Stat + + +## code ## + +class TestPath(unittest.TestCase): + def test_call(self): + # test self + self.assertEqual(os.stat(__file__), Stat()(__file__)) + # test invalid file + self.assertRaises(errors.ReaderError, Stat(), '') + self.assertRaises(errors.ReaderError, Stat(), None) + + +## main ## + +if __name__ == '__main__': + unittest.main() + +## EOF ## -- cgit v1.2.3