Skip to content

Commit

Permalink
Merge branch '212-fix-transmitter-seed-init-parameter' into 'master'
Browse files Browse the repository at this point in the history
Fix Operator Random Seed Definition

Closes #212

See merge request barkhauseninstitut/wicon/hermespy!187
  • Loading branch information
adlerjan committed May 7, 2024
2 parents 7d6da4a + ff64663 commit 430dafb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/unit_tests/core/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def sampling_rate(self) -> float:
@property
def energy(self) -> float:
return 1.0

@property
def power(self) -> float:
return 1.0
Expand All @@ -430,7 +430,13 @@ def setUp(self) -> None:
self.device = Mock()
self.device.antennas = UniformArray(IdealAntenna, 1., [2, 1, 1])
self.slot = ReceiverSlot(device=self.device)
self.receiver = ReceiverMock(slot=self.slot)
self.seed = 42
self.receiver = ReceiverMock(seed=42, slot=self.slot)

def test_init(self) -> None:
"""Initialization parameters should be properly stored as class attributes"""

self.assertEqual(self.seed, self.receiver.seed)

def test_slot_setget(self) -> None:
"""Operator slot getter should return setter argument"""
Expand Down Expand Up @@ -670,7 +676,13 @@ class TestTransmitter(TestCase):

def setUp(self) -> None:
self.device = DeviceMock()
self.transmitter = TransmitterMock(slot=self.device.transmitters)
self.seed = 42
self.transmitter = TransmitterMock(seed=42, slot=self.device.transmitters)

def test_init(self) -> None:
"""Initialization parameters should properly be stored as class attributes"""

self.assertEqual(self.seed, self.transmitter.seed)

def test_slot_setget(self) -> None:
"""Slot property getter should return setter argument"""
Expand Down

0 comments on commit 430dafb

Please sign in to comment.