forked from solidfire/solidfire-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api_method_version_error.py
More file actions
30 lines (18 loc) · 935 Bytes
/
Copy pathtest_api_method_version_error.py
File metadata and controls
30 lines (18 loc) · 935 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
#!/usr/bin/env python
from unittest.case import TestCase
from hamcrest import assert_that, equal_to
from solidfire.common import ApiMethodVersionError
class TestApiMethodVersionError(TestCase):
def test_should_map_parameters(self):
version_err = ApiMethodVersionError("aMethod", 7.0, 8.0)
assert_that(version_err.method_name, equal_to('aMethod'))
assert_that(version_err.api_version, equal_to(7.0))
def test_should_default_deprecated_to_None(self):
version_err = ApiMethodVersionError("aMethod", 7.0, 8.0)
assert_that(version_err._deprecated, equal_to(None))
def test_repr_evals_no_json(self):
version_err = ApiMethodVersionError("aMethod", 7.0, 8.0)
assert_that(eval(repr(version_err)), version_err)
def test_repr_evals(self):
version_err = ApiMethodVersionError("aMethod", 7.0, 8.0)
assert_that(eval(repr(version_err)), version_err)