예제 #1
0
    def test_config(self):
        configHandlerQuery = ConfigHandlerQuery(self.config)
        configHandler = ConfigHandlerGroupBy(
            next(iter(configHandlerQuery().groupby)))
        configuration = configHandler()

        self.assertEqual(configHandler.config, configuration)
예제 #2
0
 def test_direction(self):
     configHandlerQuery = ConfigHandlerQuery(self.config)
     configuration = configHandlerQuery()
     groupByClauses = GroupByClauses(configuration)
     for position, groupByClauseConfig in groupByClauses.clauses.items():
         groupByClause = GroupByClause(groupByClauseConfig)
         self.assertEqual(
             groupByClause.direction, configuration.groupby[position][
                 ConfigHandlerGroupBy.DIRECTION])
예제 #3
0
 def test_sort(self):
     configHandlerQuery = ConfigHandlerQuery(self.config)
     configuration = configHandlerQuery()
     groupByClauses = GroupByClauses(configuration)
     for position, groupByClauseConfig in groupByClauses.clauses.items():
         groupByClause = GroupByClause(groupByClauseConfig)
         self.assertEqual(
             groupByClause.sort,
             configuration.groupby[position][ConfigHandlerGroupBy.SORT])
예제 #4
0
 def test_aggregation(self):
     configHandlerQuery = ConfigHandlerQuery(self.config)
     configuration = configHandlerQuery()
     groupByClauses = GroupByClauses(configuration)
     for position, groupByClauseConfig in groupByClauses.clauses.items():
         groupByClause = GroupByClause(groupByClauseConfig)
         self.assertEqual(
             groupByClause.aggregation, configuration.groupby[position][
                 ConfigHandlerGroupBy.DATE_AGGREGATION])
예제 #5
0
 def test_sort(self):
     configHandlerQuery = ConfigHandlerQuery(self.config)
     configuration = configHandlerQuery()
     valueClauses = ValueClauses(configuration)
     for position, valueClausesConfig in valueClauses.clauses.items():
         valueClause = ValueClause(valueClausesConfig)
         self.assertEqual(valueClause.config, valueClausesConfig)
         self.assertEqual(
             valueClause.arrayLimit,
             configuration.values[position][ConfigHandlerValue.ARRAY_LIMIT])
예제 #6
0
 def test_config(self):
     configHandlerQuery = ConfigHandlerQuery(self.config)
     configuration = configHandlerQuery()
     groupByClauses = GroupByClauses(configuration)
     for position, groupByClauseConfig in groupByClauses.clauses.items():
         groupByClause = GroupByClause(groupByClauseConfig)
         self.assertEqual(len(groupByClause.config),
                          len(configuration.groupby[position]))
         self.assertEqual(set(groupByClause.config),
                          set(configuration.groupby[position].values()))
예제 #7
0
    def test_valueClauses(self):
        TEST_CONFIG_PATH_BASE = os.path.join('config', 'testCase1.json')

        if not os.path.exists(TEST_CONFIG_PATH_BASE):
            raise Exception("GroupByField test JSON file not found")
        config = ConfigurationStub(TEST_CONFIG_PATH_BASE)

        configHandlerQuery = ConfigHandlerQuery(config())
        configInstance = configHandlerQuery()
        valueClauses = ValueClauses(configInstance)
        composer = Composer(TEST_CONFIG_PATH_BASE)

        self.assertEqual(composer.valueClauses.clauses, valueClauses.clauses)
예제 #8
0
    def test_config(self):
        configHandler = ConfigHandlerQuery(self.config)
        configuration = configHandler()

        self.assertEqual(configHandler.config, configuration)
예제 #9
0
    def test_config(self):
        configHandlerQuery = ConfigHandlerQuery(self.config)
        valueClauses = ValueClauses(configHandlerQuery())

        self.assertEqual(configHandlerQuery.config, valueClauses.config)
예제 #10
0
    def test_clauses(self):
        configHandlerQuery = ConfigHandlerQuery(self.config)
        valueClauses = ValueClauses(configHandlerQuery())

        self.assertEqual(len(configHandlerQuery().values),
                         len(valueClauses.clauses))
예제 #11
0
    def test_config(self):
        configHandlerQuery = ConfigHandlerQuery(self.config)
        groupByClauses = GroupByClauses(configHandlerQuery())

        self.assertEqual(configHandlerQuery.config, groupByClauses.config)
예제 #12
0
    def test_clauses(self):
        configHandlerQuery = ConfigHandlerQuery(self.config)
        groupByClauses = GroupByClauses(configHandlerQuery())

        self.assertEqual(len(configHandlerQuery().values),
                         len(groupByClauses.clauses))
예제 #13
0
    def test_config(self):
        configHandler = ConfigHandlerQuery(self.config)
        configuration = configHandler()
        query = QueryClause(configuration)

        self.assertEqual(query.config, configHandler.config)
예제 #14
0
    def test_groupby(self):
        configHandler = ConfigHandlerQuery(self.config)
        configuration = configHandler()
        query = QueryClause(configuration)

        self.assertEqual(query.groupby, self.config[configHandler.GROUPBY])
예제 #15
0
    def test_limit(self):
        configHandler = ConfigHandlerQuery(self.config)
        configuration = configHandler()
        query = QueryClause(configuration)

        self.assertEqual(query.limit, self.config[configHandler.LIMIT])
예제 #16
0
    def test_values(self):
        configHandler = ConfigHandlerQuery(self.config)
        configuration = configHandler()
        query = QueryClause(configuration)

        self.assertEqual(query.values, self.config[configHandler.VALUES])
예제 #17
0
    def test_table(self):
        configHandler = ConfigHandlerQuery(self.config)
        configuration = configHandler()
        query = QueryClause(configuration)

        self.assertEqual(query.table, self.config[configHandler.TABLE])