Skip to content

Commit

Permalink
chore(tests): remove non working module
Browse files Browse the repository at this point in the history
  • Loading branch information
GhislainJ committed Nov 14, 2023
1 parent 1058839 commit fd8ebae
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 46 deletions.
45 changes: 0 additions & 45 deletions tests/test_serialization/non_dessia_object_subobjects.py

This file was deleted.

47 changes: 46 additions & 1 deletion tests/test_serialization/test_pointers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,52 @@
import unittest
from tests.test_serialization.non_dessia_object_subobjects import container, line
from dessia_common import REF_MARKER

from typing import List
from dessia_common.core import DessiaObject


class Point:
def __init__(self, x: float):
self.x = x

def __eq__(self, other):
return self.x == other.x

def __hash__(self):
return self.x

def to_dict(self):
return {"x": self.x}

@classmethod
def dict_to_object(cls, dict_):
return cls(x=dict_["x"])


class Container(DessiaObject):
def __init__(self, points: List[Point], name: str = ""):
self.points = points
self.name = name

super().__init__(name)


class Line(DessiaObject):
def __init__(self, p1: Point, p2: Point, name: str = ""):
self.p1 = p1
self.p2 = p2
self.name = name

super().__init__(name)


a = Point(0)
b = Point(1)
c = Point(0)

container = Container([a, b, c])
line = Line(a, c)


class TestNonDessiaObjects(unittest.TestCase):

Expand Down

0 comments on commit fd8ebae

Please sign in to comment.