def test_portal_remote_does_nothing(self, mock_subproc_glob): Runtime.config['addresses'] = ["172.16.1.17"] mock_subproc_glob.return_value = ["/some/path"] self.pt = Portals() assert self.pt.cmds == []
def test_create(self, mock_subproc_popen): Runtime.config['addresses'] = ["172.16.1.17"] Runtime.config['portals'] = {} Runtime.config['portals']["iqn.xyz"] = {} Runtime.config['portals']["iqn.xyz"]["archive"] = {} Runtime.config['portals']["iqn.xyz"]["archive"]["portal1"] = "1" mock_subproc_popen.return_value = [] self.pt = Portals() self.pt.create() assert mock_subproc_popen.called