コード例 #1
0
 def test_raises_exception_when_rwType_unknown(self):
     with pytest.raises(Exception):
         root = objectify.fromstring('<attributes rwType="UNKNOWN"/>')
         get_access(root)
コード例 #2
0
 def test_raises_exception_when_type_missing(self):
     with pytest.raises(Exception):
         root = objectify.fromstring(
             '<dataType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>'
         )
         get_access(root)
コード例 #3
0
 def test_raises_exception_when_rwType_missing(self):
     with pytest.raises(Exception):
         root = objectify.fromstring('<attributes/>')
         get_access(root)
コード例 #4
0
 def test_raises_exception_when_param_none(self):
     with pytest.raises(Exception):
         get_access(None)
コード例 #5
0
 def test_returns_rww(self):
     root = objectify.fromstring('<attributes rwType="READ_WITH_WRITE"/>')
     assert get_access(root) == "rww"
コード例 #6
0
 def test_returns_w(self):
     root = objectify.fromstring('<attributes rwType="WRITE"/>')
     assert get_access(root) == "w"
コード例 #7
0
 def test_returns_r(self):
     root = objectify.fromstring('<attributes rwType="READ"/>')
     assert get_access(root) == "r"