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