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