def test_move_with_hints_xml(): aMove = Move(5, 3, MoveDirection.DownRight) aMove.addHint('some debug').addHint('more debug') expectedXML = lxml.etree.XML( """<data class="move" x="5" y="3" direction="DOWN_RIGHT"> <hint content="some debug" /> <hint content="more debug" /> </data>""") assert lxml.etree.tostring(aMove.toXML(), pretty_print=True) \ == lxml.etree.tostring(expectedXML, pretty_print=True)
def test_hint(): aMove = Move(1, 3, MoveDirection.Down) aMove.addHint('special move') assert aMove.hints == ['special move']