Example #1
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     server = gnats.Server('somehost')
     conn = FakeServerConnectionForDB(server)
     self.db = Database(server, 'testdb', conn)
     self.db._validate = self.my_validate
     self.pr_in = ''
     self.validate_in = ''
Example #2
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     server = gnats.Server('somehost')
     conn = FakeServerConnectionForDB(server)
     self.db = Database(server, 'testdb', conn)
     self.db.validate_field = self.my_validate_field
     self.fname_in = []
     self.pr_in = []
     self.check_cr_in = []
     self.vf_out = []
Example #3
0
    parser.add_option('-H',
                      '--host',
                      dest='host',
                      action="store",
                      help='Host to connect to, defaults to "%default".',
                      default='localhost')
    parser.add_option('-d',
                      '--database',
                      dest='db',
                      action="store",
                      help='Database to connect to, defaults to "%default".',
                      default='default')
    parser.add_option('-q',
                      '--quiet',
                      dest='quiet',
                      action="store_true",
                      help='Emit no output',
                      default=False)
    options, args = parser.parse_args()

    if options.quiet:
        logging.basicConfig(level=logging.FATAL)
    else:
        logging.basicConfig(level=logging.DEBUG)

    db = gnats.Server(options.host, port=options.port).get_database(options.db)

    if not options.quiet:
        print db
#        for f in db.list_fields():
#            print f
Example #4
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     server = gnats.Server('somehost')
     conn = FakeServerConnectionForDB(server)
     self.db = Database(server, 'testdb', conn)
Example #5
0
 def setUp(self):
     self.server = gnats.Server('somehost')
     self.conn = FakeServerConnectionForDB(self.server)
     self.db = Database(self.server, 'testdb', self.conn)
Example #6
0
 def setUp(self):
     self.server = gnats.Server('somehost')
     self.conn = FakeServerConnectionForDB(self.server)
     self.db = Database(self.server, 'testdb', self.conn)
     self.tfield = self.db.fields['change-log']
Example #7
0
 def setUp(self):
     self.server = gnats.Server('somehost')
     self.conn = FakeServerConnectionForDB(self.server)
     self.db = Database(self.server, 'testdb', self.conn)
     self.enum = self.db.fields['enum-fld']
     self.multi = self.db.fields['multienum-fld']
Example #8
0
 def setUp(self):
     self.server = gnats.Server('somehost')
     self.conn = FakeServerConnectionForDB(self.server)
     gnats.metadata_level = gnats.FULL_METADATA