def setUp(self): self.c = MaasClient(AUTH) self.tag = 'a-test-tag-' + randomString() res = self.c.tag_new(self.tag) self.assertTrue(res)
def setUp(self): self.c = MaasClient(AUTH) self.zone_name = 'testzone-' + randomString() res = self.c.zone_new(self.zone_name, 'zone created in unittest') self.assertTrue(res)
# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # Usage: # juju bootstrap # nose test import unittest import os import sys sys.path.insert(0, '../cloudinstall') from cloudinstall.juju.client import JujuClient from cloudinstall.utils import randomString JUJU_PASS = os.environ.get('JUJU_PASS', randomString()) JUJU_URL = os.environ.get('JUJU_URL', 'wss://juju-bootstrap.master:17070/') JUJU_INSTALLED = os.path.exists(os.path.join(os.path.expanduser('~'), '.juju/environments.yaml')) #@unittest.skipIf(not JUJU_INSTALLED, "Juju is not installed") @unittest.skip("Juju websocket client is temporarily disabled.") class JujuClientTest(unittest.TestCase): def setUp(self): self.c = JujuClient(url=JUJU_URL) def tearDown(self): self.c.close() def test_login(self): self.c.login(JUJU_PASS)