File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3734,12 +3734,18 @@ def test_svg_board(self):
37343734
37353735 def test_svg_arrows (self ):
37363736 svg = chess .svg .board (arrows = [(chess .A1 , chess .A1 )])
3737- self .assertIn ("<circle" , svg )
3738- self .assertNotIn ("<line" , svg )
3737+ parsed_svg = chess .svg .ET .fromstring (svg )
3738+ ns = {"svg" : "http://www.w3.org/2000/svg" }
3739+
3740+ self .assertIsNotNone (parsed_svg .find ("./svg:circle" , ns ))
3741+ self .assertIsNone (parsed_svg .find ("./*[@class='arrow']" , ns ))
37393742
37403743 svg = chess .svg .board (arrows = [chess .svg .Arrow (chess .A1 , chess .H8 )])
3741- self .assertNotIn ("<circle" , svg )
3742- self .assertIn ("<line" , svg )
3744+ parsed_svg = chess .svg .ET .fromstring (svg )
3745+
3746+ self .assertIsNone (parsed_svg .find ("./svg:circle" , ns ))
3747+
3748+ self .assertIsNotNone (parsed_svg .find ("./svg:polygon[@class='arrow']" , ns ))
37433749
37443750 def test_svg_piece (self ):
37453751 svg = chess .svg .piece (chess .Piece .from_symbol ("K" ))
You can’t perform that action at this time.
0 commit comments