def test_site_pool(self): site.create(self.test_site, get_free_port(),\ r"C:\inetpub\wwwroot\mysite", self.test_pool) time.sleep(2) assert self.test_site in iis.get_site_names(), "Failed to create the site" assert self.test_pool in iis.get_pool_names(), "Failed to create the pool" site.delete(self.test_site) pool.delete(self.test_pool) assert self.test_site not in iis.get_site_names(), "Failed to delete the site" assert self.test_pool not in iis.get_pool_names(), "Failed to delete the pool"
def test_site_pool_state(self): site.create(self.test_site, get_free_port(),\ r"C:\inetpub\wwwroot\asite", self.test_pool) site.stop(self.test_site) assert not site.is_running(self.test_site), "Failed to stop the site" site.start(self.test_site) assert site.is_running(self.test_site), "Failed to start the site" pool.stop(self.test_pool) assert not pool.is_running(self.test_pool), "Failed to stop the pool" pool.start(self.test_pool) assert pool.is_running(self.test_pool), "Failed to start the pool" site.delete(self.test_site) pool.delete(self.test_pool)
def test_site_pool(self): site.create(self.test_site, get_free_port(),\ r"C:\inetpub\wwwroot\mysite", self.test_pool) time.sleep(2) assert self.test_site in iis.get_site_names( ), "Failed to create the site" assert self.test_pool in iis.get_pool_names( ), "Failed to create the pool" site.delete(self.test_site) pool.delete(self.test_pool) assert self.test_site not in iis.get_site_names( ), "Failed to delete the site" assert self.test_pool not in iis.get_pool_names( ), "Failed to delete the pool"
def test_binding(self): port = get_free_port() site.create(self.test_site, port,\ r"C:\inetpub\wwwroot\asite",\ self.test_pool, protocol='https') binding = site.get_bindings(self.test_site) exp_binding = ["https/:%i:" % port] assert binding == exp_binding,\ "Invalid binding. Expected:%s\nActual:%s"\ % (exp_binding, binding) site.add_binding(self.test_site, 'net.tcp', 808) binding = sorted(site.get_bindings(self.test_site)) exp_binding = sorted(["https/:%i:" % port, "net.tcp/:808:"]) assert binding == exp_binding,\ "Invalid binding. Expected:%s\nActual:%s"\ % (exp_binding, binding) site.delete(self.test_site) pool.delete(self.test_pool)
def tearDownClass(self): site.delete(self.test_site) pool.delete(self.test_pool)