aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/reader/test_path.py28
-rw-r--r--test/reader/test_stat.py34
2 files changed, 62 insertions, 0 deletions
diff --git a/test/reader/test_path.py b/test/reader/test_path.py
new file mode 100644
index 0000000..fd7bc5a
--- /dev/null
+++ b/test/reader/test_path.py
@@ -0,0 +1,28 @@
+"""
+
+Part of the bsie test suite.
+A copy of the license is provided with the project.
+Author: Matthias Baumgartner, 2022
+"""
+# imports
+import unittest
+
+# objects to test
+from bsie.reader.path import Path
+
+
+## code ##
+
+class TestPath(unittest.TestCase):
+ def test_call(self):
+ self.assertEqual('', Path()(''))
+ self.assertEqual('/tmp/foo/bar', Path()('/tmp/foo/bar'))
+ self.assertEqual('/home/myself/some file', Path()('/home/myself/some file'))
+
+
+## main ##
+
+if __name__ == '__main__':
+ unittest.main()
+
+## EOF ##
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 ##