Ejemplo n.º 1
0
    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 == []
Ejemplo n.º 2
0
    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