def test_001(self):
        HEADING()
        d = self.d

        banner("VM Data")
        pprint(d.__dict__)

        banner("Add VM")
        cm = CloudmeshDatabase()

        name = "vm1"
        uuid = d.id

        vm = VM(name=name,
                uuid=uuid,
                type="VM",
                cloud="mycloud",
                **d)

        pprint (vm.__dict__)
        vm.bla = "bla"
        cm.add(vm)
        cm.save()


        banner("Get VM from Database")

        o = cm.find(VM, name=name).first()
        #o = cm.find_by_name(VM, name)
        pprint (o.__dict__)


        assert True
Exemple #2
0
    def test_001(self):
        HEADING()
        d = self.d

        banner("VM Data")
        pprint(d.__dict__)

        banner("Add VM")
        cm = CloudmeshDatabase()

        name = "vm1"
        uuid = d.id

        vm = VM(name=name,
                uuid=uuid,
                user="******",
                type="VM",
                category="mycloud",
                **d)
        banner("VM added")

        pprint(vm.__dict__)
        vm.bla = "bla"
        cm.add(vm)
        cm.save()

        banner("Get VM from Database")

        o = cm.find(VM, name=name)
        #o = cm.find_by_name(VM, name)
        pprint(o)

        assert True
    def test_001_query(self):
        """testing cm list --cloud india default"""
        HEADING()
        cm = CloudmeshDatabase(user="******")
        m = DEFAULT("hallo", "world")
        cm.add(m)

        n = cm.query(DEFAULT).filter_by(name="hallo").first()

        print(n.__dict__)

        # assert n.__dict__["name"] == 'hallo'
        # assert n.__dict__["value"] == 'world'

        pprint(n.__dict__)
    def test_001_query(self):
        """testing cm list --cloud ... default"""
        HEADING()
        cm = CloudmeshDatabase(user="******")
        m = DEFAULT("hallo", "world")
        cm.add(m)

        n = cm.query(DEFAULT).filter_by(name='hallo').first()

        print(n.__dict__)

        #assert n.__dict__["name"] == 'hallo'
        #assert n.__dict__["value"] == 'world'

        pprint(n.__dict__)