def test_create_site(self): ''' Test - Create a basic website in IIS. ''' kwargs = {'name': 'MyTestSite', 'sourcepath': r'C:\inetpub\wwwroot', 'apppool': 'MyTestPool', 'hostheader': 'mytestsite.local', 'ipaddress': '*', 'port': 80, 'protocol': 'http'} with patch.dict(win_iis.__salt__): self.assertTrue(win_iis.create_site(**kwargs))
def test_create_site(self): ''' Test - Create a basic website in IIS. ''' kwargs = {'name': 'MyTestSite', 'sourcepath': r'C:\inetpub\wwwroot', 'apppool': 'MyTestPool', 'hostheader': 'mytestsite.local', 'ipaddress': '*', 'port': 80, 'protocol': 'http'} with patch.dict(win_iis.__salt__), \ patch('salt.modules.win_iis._srvmgr', MagicMock(return_value={'retcode': 0})), \ patch('salt.modules.win_iis.list_sites', MagicMock(return_value=dict())), \ patch('salt.modules.win_iis.list_apppools', MagicMock(return_value=dict())): self.assertTrue(win_iis.create_site(**kwargs))
def test_create_site(self): """ Test - Create a basic website in IIS. """ kwargs = { "name": "MyTestSite", "sourcepath": r"C:\inetpub\wwwroot", "apppool": "MyTestPool", "hostheader": "mytestsite.local", "ipaddress": "*", "port": 80, "protocol": "http", } with patch.dict(win_iis.__salt__), patch( "salt.modules.win_iis._srvmgr", MagicMock(return_value={"retcode": 0})), patch( "salt.modules.win_iis.list_sites", MagicMock(return_value=dict())), patch( "salt.modules.win_iis.list_apppools", MagicMock(return_value=dict())): self.assertTrue(win_iis.create_site(**kwargs))