def test_create_vdir(self): ''' Test - Create an IIS virtual directory. ''' kwargs = {'name': 'TestVdir', 'site': 'MyTestSite', 'sourcepath': r'C:\inetpub\vdirs\TestVdir'} with patch.dict(win_iis.__salt__): self.assertTrue(win_iis.create_vdir(**kwargs))
def test_create_vdir(self): ''' Test - Create an IIS virtual directory. ''' kwargs = {'name': 'TestVdir', 'site': 'MyTestSite', 'sourcepath': r'C:\inetpub\vdirs\TestVdir'} with patch.dict(win_iis.__salt__), \ patch('os.path.isdir', MagicMock(return_value=True)), \ patch('salt.modules.win_iis._srvmgr', MagicMock(return_value={'retcode': 0})), \ patch('salt.modules.win_iis.list_vdirs', MagicMock(return_value=VDIR_LIST)): self.assertTrue(win_iis.create_vdir(**kwargs))
def test_create_nested_vdir(self): """ Test - Create a nested IIS virtual directory. """ kwargs = { "name": "Test/Nested/Vdir", "site": "MyTestSite", "sourcepath": r"C:\inetpub\vdirs\NestedTestVdir", } with patch.dict(win_iis.__salt__), patch( "os.path.isdir", MagicMock(return_value=True)), patch( "salt.modules.win_iis._srvmgr", MagicMock(return_value={"retcode": 0})), patch( "salt.modules.win_iis.list_vdirs", MagicMock(return_value=NESTED_VDIR_LIST)): self.assertTrue(win_iis.create_vdir(**kwargs))