

def test__on_taskend(self):
    ' SiteBlock.on_taskend: removes domain blocks from hosts file.\n            '
    open(self.backup_hosts_file, 'w', 0).write(_HOST_FILE_DATA)
    open(self.plugin.hosts_file, 'w', 0).write(_BLKD_HOST_FILE_DATA)
    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_taskend(self.task)
    self.assertEqual(open(self.plugin.hosts_file, 'r').read(), _HOST_FILE_DATA)
    self.assertFalse(os.path.isfile(self.backup_hosts_file))

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