def test_from_signal_and_connection_force_width(self, latching, width): # Create the mock signal and connection signal = mock.Mock(name="signal", spec_set=["latching"]) signal.latching = latching with nengo.Network(): a = nengo.Ensemble(100, width) b = nengo.Ensemble(100, width) connection = nengo.Connection(a, b, synapse=None) # Build the filter nf = NoneFilter.from_signal_and_connection(signal, connection, width=1) assert NoneFilter(1, latching) == nf
def test_from_signal_and_connection_to_slice(self, latching): # Create the mock signal and connection signal = mock.Mock(name="signal", spec_set=["latching"]) signal.latching = latching with nengo.Network(): a = nengo.Ensemble(100, 2) b = nengo.Ensemble(100, 2) connection = nengo.Connection(a[1], b[0], synapse=None) # Build the filter nf = NoneFilter.from_signal_and_connection(signal, connection) assert NoneFilter(2, latching) == nf