Make testing easier with rtbl.BL.init mapping to add testing item to the
block list (locally).
Generate a hash:
>>> import hashlib
>>> test_hash = hashlib.sha256('user@example.org'.encode('utf-8')).hexdigest()
Then use it to pre-populate the block list:
>>> from sid.rtbl import RTBL, BL
>>> BL.init = {test_hash: 'For testing purposes'}
class BL:
"""Plain object to keep track of block list items.
Only used in RTBL plugin."""
+ #: Initial seed to ease testing
+ init = {}
def __init__(self, initial_bl):
- self.sha256_jids: Dict[str, Optional[str]] = {}
+ self.sha256_jids: Dict[str, Optional[str]] = dict(BL.init)
for item in initial_bl:
self.insert_item(item)