File: python_test_check_fuse_device.patch

package info (click to toggle)
rdiff-backup-fs 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 460 kB
  • sloc: ansic: 3,002; python: 231; makefile: 26
file content (25 lines) | stat: -rw-r--r-- 794 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Syed-Shahrukh Hussain <syed.shahrukh@ossrevival.org>
Date: Thu, 04 Feb 2026 10:00:06 +0500
Subject: Ignore python tests when fuse device is not available.
Forwarded: https://github.com/rdiff-backup/rdiff-backup-fs/pull/14

--- a/tests.py
+++ b/tests.py
@@ -3,7 +3,7 @@
 # TODO:
 # - check for files, that should not exist
 
-from os import walk, remove, rmdir, mknod, mkdir, listdir, stat
+from os import walk, remove, rmdir, mknod, mkdir, listdir, stat, path
 from os.path import join, exists, split, sep as fssep, isdir
 from unittest import TestCase, main
 from subprocess import Popen
@@ -273,4 +273,7 @@
 
 
 if __name__ == "__main__":
-    main()
+    if not path.exists('/dev/fuse'):
+        print("Notice: Unable to run tests. FUSE device not found.")
+    else:
+        main()