Skip to content

Commit

Permalink
refactor: change parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucs1590 committed Apr 11, 2024
1 parent 50c6a8e commit 56ab6ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import logging
import webbrowser
from xml.dom import minidom
from defusedxml.minidom import parseString

import questionary

Expand Down Expand Up @@ -138,7 +138,7 @@ def indent_xml_file(file_path: str) -> None:
with open(file_path, "r") as xml_file:
xml_content = xml_file.read()

xml_dom = minidom.parseString(xml_content)
xml_dom = parseString(xml_content)

with open(file_path, "w") as xml_file:
xml_file.write(xml_dom.toprettyxml(indent=" "))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_indent_xml_file(self):
def test_indent_xml_file_error(self):
file_path = "assets/test.xml"

with patch('src.main.minidom.parseString') as mock_parseString:
with patch('src.main.parseString') as mock_parseString:
mock_parseString.return_value = Exception("Error")
indent_xml_file(file_path)

Expand Down

0 comments on commit 56ab6ec

Please sign in to comment.