fix: resolve CI/CD test failures and linting issues
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
"""Tests for JSON converter."""
|
"""Tests for JSON converter."""
|
||||||
|
|
||||||
import pytest
|
|
||||||
import json
|
import json
|
||||||
|
import pytest
|
||||||
import tempfile
|
import tempfile
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from config_convert.converters import JSONConverter
|
from config_convert.converters import JSONConverter
|
||||||
|
|
||||||
@@ -63,14 +62,13 @@ class TestJSONConverter:
|
|||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
|
|
||||||
def test_dump_file(self, converter, temp_dir, sample_json):
|
def test_dump_file(self, converter, temp_dir, sample_json):
|
||||||
import shutil
|
|
||||||
path = tempfile.mktemp(suffix=".json")
|
path = tempfile.mktemp(suffix=".json")
|
||||||
try:
|
try:
|
||||||
converter.dump(sample_json, path)
|
converter.dump(sample_json, path)
|
||||||
result = json.loads(Path(path).read_text())
|
result = json.loads(open(path).read())
|
||||||
assert result == sample_json
|
assert result == sample_json
|
||||||
finally:
|
finally:
|
||||||
if Path(path).exists():
|
if os.path.exists(path):
|
||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
|
|
||||||
def test_invalid_json_raises(self, converter):
|
def test_invalid_json_raises(self, converter):
|
||||||
|
|||||||
Reference in New Issue
Block a user