Ejemplo n.º 1
0
    def setup_class(self):
        '''
            setup_class - Called at the beginning of the test

                Sets configuration based on LocalConfig
        '''
        LocalConfig.ensureTestSetup()
Ejemplo n.º 2
0
    def setup_class(self):
        '''
            setup_class - ensure this test is setup.
                Executed prior to any of the tests in this class.
        '''
        LocalConfig.ensureTestSetup()

        self.datasetUid = str(uuid.uuid4())
Ejemplo n.º 3
0
 def enable_service(self, name, en = True):
     ''' 使能/禁用服务 '''
     ssd = LocalConfig.load_config(FNAME)
     for s in ssd['services']:
         print s['name']
         if s['name'] == name:
            s['enable'] = en
            break
     LocalConfig.save_config(FNAME, ssd)
Ejemplo n.º 4
0
 def enable_service(self, name, en=True):
     ''' 使能/禁用服务 '''
     ssd = LocalConfig.load_config(FNAME)
     for s in ssd['services']:
         print s['name']
         if s['name'] == name:
             s['enable'] = en
             break
     LocalConfig.save_config(FNAME, ssd)
Ejemplo n.º 5
0
 def list_services(self):
     ''' 返回所有服务列表, 并且将服务的 url 中的 ip 部分,换成自己的 ..
     '''
     ssd = LocalConfig.load_config(FNAME)
     ss = ssd['services']
     for s in ss:
         if 'url' in s:
             new_url = self.__fix_url(s['url'])
             s['url'] = new_url
     return ss
Ejemplo n.º 6
0
 def list_services(self):
     ''' 返回所有服务列表, 并且将服务的 url 中的 ip 部分,换成自己的 ..
     '''
     ssd = LocalConfig.load_config(FNAME)
     ss = ssd['services']
     for s in ss:
         if 'url' in s:
             new_url = self.__fix_url(s['url'])
             s['url'] = new_url
     return ss
Ejemplo n.º 7
0
 def setup_class(self):
     LocalConfig.ensureTestSetup()
Ejemplo n.º 8
0
    def setup_class(self):
        '''
            setup_class - ensure this test is setup.
                Executed prior to any of the tests in this class.
        '''
        LocalConfig.ensureTestSetup()

        dbConn = ichorORM.getDatabaseConnection()
        try:
            dbConn.executeSql("DELETE FROM " + MyPersonModel.TABLE_NAME)
        except:
            dbConn.executeSql(
                "CREATE TABLE %s ( id serial primary key, first_name varchar(255) NOT NULL, last_name varchar(255) NOT NULL, age smallint, birth_day smallint, birth_month smallint )"
                % (MyPersonModel.TABLE_NAME, ))

        # NOTE: "id" will be set upon insert
        self.dataSet = [
            {
                "id": None,
                "first_name": 'John',
                'last_name': 'Smith',
                'age': 43,
                'birth_day': 4,
                'birth_month': 11
            },
            {
                "id": None,
                "first_name": 'John',
                'last_name': 'Doe',
                'age': 38,
                'birth_day': 2,
                'birth_month': 12
            },
            {
                "id": None,
                "first_name": 'Jane',
                'last_name': 'Doe',
                'age': 25,
                'birth_day': 8,
                'birth_month': 5
            },
            {
                "id": None,
                "first_name": 'Cathy',
                'last_name': 'Lawson',
                'age': 14,
                'birth_day': 6,
                'birth_month': 8
            },
            {
                "id": None,
                "first_name": 'Tom',
                'last_name': 'Brown',
                'age': 65,
                'birth_day': 2,
                'birth_month': 9
            },
        ]

        self.nullDataSet = [
            {
                "id": None,
                "first_name": 'Henry',
                'last_name': 'Thomson',
                'age': None,
                'birth_day': None,
                'birth_month': None
            },
            {
                "id": None,
                "first_name": 'Frank',
                'last_name': "L'ray",
                'age': None,
                'birth_day': None,
                'birth_month': None
            },
            {
                "id": None,
                "first_name": 'Bob',
                'last_name': 'Bizzle',
                'age': None,
                'birth_day': None,
                'birth_month': None
            },
        ]