from __future__ import print_function import unittest import sys import os from Milter.policy import MTAPolicy class Config(object): def __init__(self): self.access_file='test/access.db' self.access_file_nulls=True self.access_file_colon = False class PolicyTestCase(unittest.TestCase): def setUp(self): self.config = Config() if os.access('test/access',os.R_OK): if not os.path.exists('test/access.db') or \ os.path.getmtime('test/access') > os.path.getmtime('test/access.db'): cmd = 'tr : ! = 2: e,k = a[:2] with MTAPolicy(e,conf=Config()) as p: pol = p.getPolicy(k) print(pol) a = a[2:]