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