Example #1
0
 def test_raises_exception_when_rwType_unknown(self):
     with pytest.raises(Exception):
         root = objectify.fromstring('<attributes rwType="UNKNOWN"/>')
         get_access(root)
Example #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)
Example #3
0
 def test_raises_exception_when_rwType_missing(self):
     with pytest.raises(Exception):
         root = objectify.fromstring('<attributes/>')
         get_access(root)
Example #4
0
 def test_raises_exception_when_param_none(self):
     with pytest.raises(Exception):
         get_access(None)
Example #5
0
 def test_returns_rww(self):
     root = objectify.fromstring('<attributes rwType="READ_WITH_WRITE"/>')
     assert get_access(root) == "rww"
Example #6
0
 def test_returns_w(self):
     root = objectify.fromstring('<attributes rwType="WRITE"/>')
     assert get_access(root) == "w"
Example #7
0
 def test_returns_r(self):
     root = objectify.fromstring('<attributes rwType="READ"/>')
     assert get_access(root) == "r"