blob: 2b2fa643ce978657b05c5404bda797e3e8fcf1c4 (
plain)
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
26
|
"""
fs.tests.test_errors: testcases for the fs error classes functions
"""
import unittest
import fs.tests
from fs.errors import *
import pickle
from fs.path import *
class TestErrorPickling(unittest.TestCase):
def test_pickling(self):
def assert_dump_load(e):
e2 = pickle.loads(pickle.dumps(e))
self.assertEqual(e.__dict__,e2.__dict__)
assert_dump_load(FSError())
assert_dump_load(PathError("/some/path"))
assert_dump_load(ResourceNotFoundError("/some/other/path"))
assert_dump_load(UnsupportedError("makepony"))
|