コード例 #1
0
ファイル: argparse_test.py プロジェクト: vollkorn1982/alot
 def test_char_special(self):
     with self.assertRaises(cargparse.ValidationFailed):
         cargparse.require_file('/dev/null')
コード例 #2
0
ファイル: argparse_test.py プロジェクト: vollkorn1982/alot
 def test_dir(self):
     with temporary_directory() as d:
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.require_file(d)
コード例 #3
0
ファイル: argparse_test.py プロジェクト: vollkorn1982/alot
 def test_file(self):
     with tempfile.NamedTemporaryFile() as f:
         cargparse.require_file(f.name)
コード例 #4
0
ファイル: argparse_test.py プロジェクト: vollkorn1982/alot
 def test_fifo(self):
     with temporary_directory() as d:
         path = os.path.join(d, 'fifo')
         os.mkfifo(path)
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.require_file(path)
コード例 #5
0
ファイル: argparse_test.py プロジェクト: vollkorn1982/alot
 def test_doesnt_exist(self):
     with temporary_directory() as d:
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.require_file(os.path.join(d, 'doesnt-exist'))
コード例 #6
0
ファイル: argparse_test.py プロジェクト: GuillaumeSeren/alot
 def test_file(self):
     with tempfile.NamedTemporaryFile() as f:
         cargparse.require_file(f.name)
コード例 #7
0
ファイル: argparse_test.py プロジェクト: GuillaumeSeren/alot
 def test_dir(self):
     with temporary_directory() as d:
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.require_file(d)
コード例 #8
0
ファイル: argparse_test.py プロジェクト: GuillaumeSeren/alot
 def test_doesnt_exist(self):
     with temporary_directory() as d:
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.require_file(os.path.join(d, 'doesnt-exist'))
コード例 #9
0
ファイル: argparse_test.py プロジェクト: GuillaumeSeren/alot
 def test_fifo(self):
     with temporary_directory() as d:
         path = os.path.join(d, 'fifo')
         os.mkfifo(path)
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.require_file(path)
コード例 #10
0
ファイル: argparse_test.py プロジェクト: GuillaumeSeren/alot
 def test_char_special(self):
     with self.assertRaises(cargparse.ValidationFailed):
         cargparse.require_file('/dev/null')