コード例 #1
0
ファイル: tests.py プロジェクト: JAvito-GC/Linux-Utils
 def test_coerce_device_file(self):
     """Test coercion of device identifiers to device files."""
     assert coerce_device_file(
         '/dev/mapper/backups') == '/dev/mapper/backups'
     assert (coerce_device_file('LABEL="Linux Boot"') ==
             r'/dev/disk/by-label/Linux\x20Boot')
     assert (coerce_device_file('UUID=1012dd1a-a455-40c4-914f-f3b1b2cf5b86')
             == '/dev/disk/by-uuid/1012dd1a-a455-40c4-914f-f3b1b2cf5b86')
     self.assertRaises(
         ValueError,
         coerce_device_file,
         'PARTUUID=e6c021cc-d0d8-400c-8f5c-b10adeff65fe',
     )
コード例 #2
0
    def source_device(self):
        """
        The block special device or file that contains the encrypted data (a string).

        The value of this property is computed by passing :attr:`source` to
        :func:`.coerce_device_file()`.
        """
        return coerce_device_file(self.source)
コード例 #3
0
ファイル: fstab.py プロジェクト: JAvito-GC/Linux-Utils
    def device_file(self):
        """
        The block special device to be mounted (a string).

        The value of this property is computed by passing :attr:`device` to
        :func:`.coerce_device_file()`.
        """
        return coerce_device_file(self.device)