Skip to content

Commit

Permalink
warn => warning
Browse files Browse the repository at this point in the history
Fixes #43
  • Loading branch information
LukeCarrier committed Mar 8, 2024
1 parent 05372ef commit a54d24c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mkdocs_drawio_exporter/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def drawio_executable_paths(self, platform):
program_files.append(os.environ['ProgramFiles(x86)'])
return [os.path.join(dir, 'draw.io', 'draw.io.exe') for dir in program_files]
else:
self.log.warn('Draw.io executable paths not known for platform "{}"'.format(platform))
self.log.warning('Draw.io executable paths not known for platform "{}"'.format(platform))

def prepare_cache_dir(self, cache_dir, docs_dir):
"""Ensure the cache path is set, absolute and exists.
Expand Down Expand Up @@ -264,7 +264,7 @@ def ensure_file_cached(self, source, source_rel, page_index, drawio_executable,
self.log.debug('Source file appears unchanged; using cached copy from "{}"'.format(cache_filename))
else:
if not drawio_executable:
self.log.warn('Skipping export of "{}" as Draw.io executable not available'.format(source))
self.log.warning('Skipping export of "{}" as Draw.io executable not available'.format(source))
return (None, exit_status)

self.log.debug('Exporting "{}" to "{}"'.format(source, cache_filename))
Expand Down
2 changes: 1 addition & 1 deletion mkdocs_drawio_exporter/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def on_post_build(self, config):
try:
copy_file(cache_filename, abs_dest_path)
except FileNotFoundError:
log.warn('Export successful, but wrote no output file')
log.warning('Export successful, but wrote no output file')
8 changes: 4 additions & 4 deletions mkdocs_drawio_exporter/tests/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def setUp(self):
self.exporter = DrawIoExporter(self.log)

def test_drawio_executable_paths_warns_on_unknown_platform(self):
self.log.warn = MagicMock()
self.log.warning = MagicMock()
self.exporter.drawio_executable_paths('win32-but-stable')
self.log.warn.assert_called_once()
self.log.warning.assert_called_once()

def test_prepare_cache_dir_defaults(self):
assert len(self.exporter.prepare_cache_dir(None, sep + 'docs'))
Expand Down Expand Up @@ -138,13 +138,13 @@ def test_ensure_file_cached_aborts_if_drawio_executable_unavailable(self):
self.exporter.export_file = MagicMock()
self.exporter.export_file.return_value = 0

self.log.warn = MagicMock()
self.log.warning = MagicMock()

cache_filename, exit_status = self.exporter.ensure_file_cached(
source, source_rel, 0, drawio_executable, [], cache_dir, 'svg')

assert exit_status == None
self.log.warn.assert_called_once()
self.log.warning.assert_called_once()

def test_ensure_file_cached_skips_export_if_cache_fresh(self):
source = sep + join('docs', 'diagram.drawio')
Expand Down

0 comments on commit a54d24c

Please sign in to comment.