def test_filter_data_packet_false(self): node_a, node_b = MockNode(), MockNode() session_mock = mock.MagicMock() def f1(data_packet, *_, **__): return data_packet def f2(data_packet, *_, **__): return data_packet / 2 pipe = ZeroPipe(node_a, node_b, filters=[FNFilter(f1), FNFilter(f2)], filters_threshold=1.1) assert pipe.filter_data_packet(2, session_mock) is False
def test_filter_data_packet_empty(self): node_a, node_b = MockNode(), MockNode() session_mock = mock.MagicMock() pipe = ZeroPipe(node_a, node_b, filters=[]) assert pipe.filter_data_packet(..., session_mock)