Skip to content

Commit

Permalink
Improved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Dec 17, 2023
1 parent 102f018 commit ffb087c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dplib/__spec__/test_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from pathlib import Path

import pytest
Expand All @@ -24,7 +25,7 @@ def test_model_to_path(tmp_path: Path):
resource = Resource.from_path("data/resource.json")
resource.to_path(path)
with open(path) as file:
assert file.read() == '{"name": "name", "path": "table.csv"}'
assert json.loads(file.read()) == {"name": "name", "path": "table.csv"}


def test_model_from_path_emtpy_file():
Expand Down
3 changes: 1 addition & 2 deletions dplib/plugins/dcat/models/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Any, List, Optional

from rdflib import BNode, Graph, URIRef
from typing_extensions import Self

from dplib.error import Error
from dplib.model import Model
Expand Down Expand Up @@ -324,7 +323,7 @@ def to_dp(self) -> Package:
return package

@classmethod
def from_dp(cls, package: Package) -> Self:
def from_dp(cls, package: Package) -> DcatPackage:
"""Create a DCAT Package from Data Package
Parameters:
Expand Down

0 comments on commit ffb087c

Please sign in to comment.