-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy patherrors_test.py
More file actions
30 lines (20 loc) · 762 Bytes
/
Copy patherrors_test.py
File metadata and controls
30 lines (20 loc) · 762 Bytes
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
# -*- coding:utf-8 -*-
'''
Unit tests for vaspy.errors module.
'''
import unittest
from ..errors import CarfileValueError, UnmatchedDataShape
class CarfileValueErrorTest(unittest.TestCase):
def test_raise(self):
with self.assertRaises(CarfileValueError):
raise CarfileValueError("test error")
def test_message(self):
err = CarfileValueError("bad value")
self.assertEqual(str(err), "bad value")
class UnmatchedDataShapeTest(unittest.TestCase):
def test_raise(self):
with self.assertRaises(UnmatchedDataShape):
raise UnmatchedDataShape("shape mismatch")
def test_message(self):
err = UnmatchedDataShape("shape mismatch")
self.assertEqual(str(err), "shape mismatch")