Example #1
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])
Example #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])
Example #3
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])
Example #4
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()))
Example #5
0
    def test_groupByClauses(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()
        groupByClauses = GroupByClauses(configInstance)
        composer = Composer(TEST_CONFIG_PATH_BASE)

        self.assertEqual(composer.groupByClauses.clauses,
                         groupByClauses.clauses)
Example #6
0
    def test_config(self):
        configHandlerQuery = ConfigHandlerQuery(self.config)
        groupByClauses = GroupByClauses(configHandlerQuery())

        self.assertEqual(configHandlerQuery.config, groupByClauses.config)
Example #7
0
    def test_clauses(self):
        configHandlerQuery = ConfigHandlerQuery(self.config)
        groupByClauses = GroupByClauses(configHandlerQuery())

        self.assertEqual(len(configHandlerQuery().values),
                         len(groupByClauses.clauses))