コード例 #1
0
    def test_servicestate(self):
        s = db.ServiceStates()
        s.type = 0
        s.status = 0
        s = db.ServiceStates(s)

        assert s.type == 0
        assert s.status == 0
コード例 #2
0
    def test_servicestate(self):
        s = db.ServiceStates()
        s.type = 0
        s.status = 0
        s = db.ServiceStates(s)

        self.assertEqual(s.type, 0)
        self.assertEqual(s.status, 0)
コード例 #3
0
ファイル: utils.py プロジェクト: olabri/pyCA
def set_service_status(dbs, service, status):
    '''Update the status of a particular service in the database.
    '''
    srv = db.ServiceStates()
    srv.type = service
    srv.status = status

    dbs.merge(srv)
    dbs.commit()