Skip to content

Commit

Permalink
wip: a quick fix to the tests for stack
Browse files Browse the repository at this point in the history
  • Loading branch information
hanson-hschang committed Sep 9, 2024
1 parent 9987611 commit 051ddbe
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/geometry/stack/test_base_stack_stacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
class MockObjectToStack:
def __init__(self, value):
self.value = value
self.material_properties = {}

@property
def material(self):
return self.material_properties

@property
def object(self):
Expand All @@ -19,6 +24,9 @@ def create(cls, states):
def update_states(self, value):
self.value = value

def update_material(self, **kwargs):
self.material_properties.update(kwargs)


class MockStack(BaseStack[MockObjectToStack]):
DefaultType = MockObjectToStack
Expand Down Expand Up @@ -93,6 +101,11 @@ def test_update_wrong_size(update_data):
class MockObjectToStack2:
def __init__(self, value1, value2):
self.value = (value1, value2)
self.material_properties = {}

@property
def material(self):
return self.material_properties

@property
def object(self):
Expand All @@ -105,6 +118,9 @@ def create(cls, states):
def update_states(self, value1, value2):
self.value = (value1, value2)

def update_material(self, **kwargs):
self.material_properties.update(kwargs)


class Mock2Stack(BaseStack[MockObjectToStack2]):
DefaultType = MockObjectToStack2
Expand Down

0 comments on commit 051ddbe

Please sign in to comment.