

def test__on_taskrun(self):
    ' SiteBlock.on_taskrun: adds domain blocks to hosts file.\n            '
    domains = ['google.com', 'm.google.com', 'www.google.com', 'mobile.google.com', 'twitter.com', 'm.twitter.com', 'www.twitter.com', 'mobile.twitter.com']
    self.plugin.domains = set(domains)
    self.plugin.on_taskrun(self.task)
    self.assertEqual(open(self.plugin.hosts_file, 'r').read(), _BLKD_HOST_FILE_DATA)

dataset/ETHPy150Open xtrementl/focus/tests/unit/plugin/modules/test_sites.py TestSiteBlock.test__on_taskrun/original