Exemple #1
0
 def test_fifo(self):
     with temporary_directory() as d:
         path = os.path.join(d, 'fifo')
         os.mkfifo(path)
         cargparse.optional_file_like(path)
Exemple #2
0
 def test_file(self):
     with tempfile.NamedTemporaryFile() as f:
         cargparse.optional_file_like(f.name)
Exemple #3
0
 def test_char_special(self):
     cargparse.optional_file_like('/dev/null')
Exemple #4
0
 def test_doesnt_exist(self):
     with temporary_directory() as d:
         cargparse.optional_file_like(os.path.join(d, 'doesnt-exist'))
Exemple #5
0
 def test_dir(self):
     with temporary_directory() as d:
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.optional_file_like(d)
Exemple #6
0
 def test_fifo(self):
     with temporary_directory() as d:
         path = os.path.join(d, 'fifo')
         os.mkfifo(path)
         cargparse.optional_file_like(path)
Exemple #7
0
 def test_char_special(self):
     cargparse.optional_file_like('/dev/null')
Exemple #8
0
 def test_file(self):
     with tempfile.NamedTemporaryFile() as f:
         cargparse.optional_file_like(f.name)
Exemple #9
0
 def test_dir(self):
     with temporary_directory() as d:
         with self.assertRaises(cargparse.ValidationFailed):
             cargparse.optional_file_like(d)
Exemple #10
0
 def test_doesnt_exist(self):
     with temporary_directory() as d:
         cargparse.optional_file_like(os.path.join(d, 'doesnt-exist'))