Python shutil.SpecialFileError() Examples

The following are code examples for showing how to use shutil.SpecialFileError(). They are extracted from open source Python projects. You can vote up the examples you like or vote down the exmaples you don't like. You can also save this page to your account.

Example 1
Project: zippy   Author: securesystemslab   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_copyfile_named_pipe(self):
            os.mkfifo(TESTFN)
            try:
                self.assertRaises(shutil.SpecialFileError,
                                  shutil.copyfile, TESTFN, TESTFN2)
                self.assertRaises(shutil.SpecialFileError,
                                  shutil.copyfile, __file__, TESTFN)
            finally:
                os.remove(TESTFN) 
Example 2
Project: oil   Author: oilshell   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_copyfile_named_pipe(self):
        os.mkfifo(TESTFN)
        try:
            self.assertRaises(shutil.SpecialFileError,
                              shutil.copyfile, TESTFN, TESTFN2)
            self.assertRaises(shutil.SpecialFileError,
                              shutil.copyfile, __file__, TESTFN)
        finally:
            os.remove(TESTFN) 
Example 3
Project: python2-tracer   Author: extremecoders-re   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_copyfile_named_pipe(self):
        os.mkfifo(TESTFN)
        try:
            self.assertRaises(shutil.SpecialFileError,
                              shutil.copyfile, TESTFN, TESTFN2)
            self.assertRaises(shutil.SpecialFileError,
                              shutil.copyfile, __file__, TESTFN)
        finally:
            os.remove(TESTFN) 
Example 4
Project: web_ctp   Author: molebot   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_copyfile_named_pipe(self):
            os.mkfifo(TESTFN)
            try:
                self.assertRaises(shutil.SpecialFileError,
                                  shutil.copyfile, TESTFN, TESTFN2)
                self.assertRaises(shutil.SpecialFileError,
                                  shutil.copyfile, __file__, TESTFN)
            finally:
                os.remove(TESTFN) 
Example 5
Project: ouroboros   Author: pybee   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_copyfile_named_pipe(self):
        os.mkfifo(TESTFN)
        try:
            self.assertRaises(shutil.SpecialFileError,
                                shutil.copyfile, TESTFN, TESTFN2)
            self.assertRaises(shutil.SpecialFileError,
                                shutil.copyfile, __file__, TESTFN)
        finally:
            os.remove(TESTFN) 
Example 6
Project: ouroboros   Author: pybee   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_module_all_attribute(self):
        self.assertTrue(hasattr(shutil, '__all__'))
        target_api = ['copyfileobj', 'copyfile', 'copymode', 'copystat',
                      'copy', 'copy2', 'copytree', 'move', 'rmtree', 'Error',
                      'SpecialFileError', 'ExecError', 'make_archive',
                      'get_archive_formats', 'register_archive_format',
                      'unregister_archive_format', 'get_unpack_formats',
                      'register_unpack_format', 'unregister_unpack_format',
                      'unpack_archive', 'ignore_patterns', 'chown', 'which',
                      'get_terminal_size', 'SameFileError']
        if hasattr(os, 'statvfs') or os.name == 'nt':
            target_api.append('disk_usage')
        self.assertEqual(set(shutil.__all__), set(target_api)) 
Example 7
Project: ndk-python   Author: gittor   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_copyfile_named_pipe(self):
            os.mkfifo(TESTFN)
            try:
                self.assertRaises(shutil.SpecialFileError,
                                  shutil.copyfile, TESTFN, TESTFN2)
                self.assertRaises(shutil.SpecialFileError,
                                  shutil.copyfile, __file__, TESTFN)
            finally:
                os.remove(TESTFN) 
Example 8
Project: kbe_server   Author: xiaohaoppy   File: test_shutil.py    (license) View Source Project 5 votes vote down vote up
def test_copyfile_named_pipe(self):
        os.mkfifo(TESTFN)
        try:
            self.assertRaises(shutil.SpecialFileError,
                                shutil.copyfile, TESTFN, TESTFN2)
            self.assertRaises(shutil.SpecialFileError,
                                shutil.copyfile, __file__, TESTFN)
        finally:
            os.remove(TESTFN) 
Example 9
Project: pefile.pypy   Author: cloudtracer   File: test_shutil.py    (license) View Source Project 4 votes vote down vote up
def test_copyfile_named_pipe(self):
        os.mkfifo(TESTFN)
        try:
            self.assertRaises(shutil.SpecialFileError,
                              shutil.copyfile, TESTFN, TESTFN2)
            self.assertRaises(shutil.SpecialFileError,
                              shutil.copyfile, __file__, TESTFN)
        finally:
            os.remove(TESTFN)