'Verifies that the specified attribute is ``expected``.
The element whose attribute is verified is specified using ``source``
and ``xpath``. They have exactly the same semantics as with
`Get Element` keyword.
The keyword passes if the attribute ``name`` of the element is equal to
the ``expected`` value, and otherwise it fails. The default error
message can be overridden with the ``message`` argument.
To test that the element does not have a certain attribute, Python
``None`` (i.e. variable ``${NONE}``) can be used as the expected value.
A cleaner alternative is using `Element Should Not Have Attribute`.
Examples using ``${XML}`` structure from `Example`:
| Element Attribute Should Be | ${XML} | id | 1       | xpath=first |
| Element Attribute Should Be | ${XML} | id | ${NONE} |             |
See also `Element Attribute Should Match` and `Get Element Attribute`.'

def element_attribute_should_be(self, source, name, expected, xpath='.', message=None):

    attr = self.get_element_attribute(source, name, xpath)
    should_be_equal(attr, expected, message, values=False)
