forked from PyCQA/isort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_exceptions.py
58 lines (37 loc) · 1.58 KB
/
test_exceptions.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from isort import exceptions
class TestISortError:
def setup_class(self):
self.instance = exceptions.ISortError()
def test_init(self):
assert isinstance(self.instance, exceptions.ISortError)
class TestExistingSyntaxErrors(TestISortError):
def setup_class(self):
self.instance = exceptions.ExistingSyntaxErrors("file_path")
def test_variables(self):
assert self.instance.file_path == "file_path"
class TestIntroducedSyntaxErrors(TestISortError):
def setup_class(self):
self.instance = exceptions.IntroducedSyntaxErrors("file_path")
def test_variables(self):
assert self.instance.file_path == "file_path"
class TestFileSkipped(TestISortError):
def setup_class(self):
self.instance = exceptions.FileSkipped("message", "file_path")
def test_variables(self):
assert self.instance.file_path == "file_path"
assert str(self.instance) == "message"
class TestFileSkipComment(TestISortError):
def setup_class(self):
self.instance = exceptions.FileSkipComment("file_path")
def test_variables(self):
assert self.instance.file_path == "file_path"
class TestFileSkipSetting(TestISortError):
def setup_class(self):
self.instance = exceptions.FileSkipSetting("file_path")
def test_variables(self):
assert self.instance.file_path == "file_path"
class TestProfileDoesNotExist(TestISortError):
def setup_class(self):
self.instance = exceptions.ProfileDoesNotExist("profile")
def test_variables(self):
assert self.instance.profile == "profile"