def getPostingConfig(self, parent_trace, kind, manifest_nb):
        '''
        Return a PostingConfig, corresponding to the configuration that this concrete controller supports.
        '''
        ME                          = Mock_Controller
        if kind == 'hierarchy':
            update_policy               = UpdatePolicy(reuse_uids=True, merge=False)
            xlr_config                  = ME._AccountHierarchyConfig(       update_policy       = update_policy, 
                                                                            kind                = kind, 
                                                                            manifest_nb         = manifest_nb,
                                                                            controller          = self)
        elif kind == 'balances':
            update_policy               = UpdatePolicy(reuse_uids=True, merge=False)
            xlr_config                  = ME._AccountBalancesConfig(        update_policy       = update_policy, 
                                                                            kind                = kind, 
                                                                            manifest_nb         = manifest_nb,
                                                                            controller          = self)
        elif kind == 'properties':
            update_policy               = UpdatePolicy(reuse_uids=True, merge=False)
            xlr_config                  = ME._AccountPropertiesConfig(      update_policy       = update_policy, 
                                                                            kind                = kind, 
                                                                            manifest_nb         = manifest_nb,
                                                                            controller          = self)
        else:
            raise ApodeixiError(parent_trace, "Invalid domain object '" + kind + "' - should be one of "
                                                + ", ".join(self.SUPPORTED_KINDS),
                                                origination = {'signaled_from': __file__})

        return xlr_config 
예제 #2
0
    def getPostingConfig(self, parent_trace, kind, manifest_nb):
        '''
        Return a PostingConfig, corresponding to the configuration that this concrete controller supports.
        '''
        ME = Workstream_Controller
        if kind == 'workstream-milestone':
            update_policy = UpdatePolicy(reuse_uids=True, merge=False)
            xlr_config = ME._WorkstreamMilestoneConfig(
                update_policy=update_policy,
                kind=kind,
                manifest_nb=manifest_nb,
                controller=self)
        elif kind == 'workstream-metric':
            update_policy = UpdatePolicy(reuse_uids=True, merge=False)
            xlr_config = ME._WorkstreamMetricConfig(
                update_policy=update_policy,
                kind=kind,
                manifest_nb=manifest_nb,
                controller=self)
        else:
            raise ApodeixiError(parent_trace,
                                "Invalid domain object '" + kind +
                                "' - should be one of " +
                                ", ".join(self.SUPPORTED_KINDS),
                                origination={'signaled_from': __file__})

        return xlr_config
    def _create_posting_config(self, parent_trace, test_case_name):
        '''
        Returns a dummy PostingConfig object. Needed only because some of the functions we test in this module
        require it as a parameter, though all that they require is an UpdatePolicy object within the PostingConfig
        '''
        update_policy       = UpdatePolicy(reuse_uids=True, merge=False)
        kb_store            = UnitTest_KnowledgeBaseStore(  test_case_name          = test_case_name, 
                                                            input_manifests_dir     = self.input_data, 
                                                            input_postings_dir      = self.input_data, 
                                                            output_manifests_dir    = self.output_data, 
                                                            output_postings_dir     = self.output_data)
        controller          = Mock_Controller(parent_trace, store=kb_store, a6i_config=self.a6i_config)

        # To avoid error messages, we will need a dummy but structurally complete manifest meta data,
        # even if there is no real manifest here
        controller.show_your_work.keep_manifest_meta(       parent_trace            = parent_trace, 
                                                            manifest_nb             = -99, 
                                                            kind                    = "FAKE -99 KIND", 
                                                            excel_range             = "A1:B2",
                                                            excel_sheet             = "FAKE WORSHEET")        
        xlr_config          = PostingConfig(    kind            = "FAKE -99 KIND", 
                                                manifest_nb     = -99, # None would trigger error, so put a dummy number
                                                update_policy   = update_policy, 
                                                controller      = controller)
        return xlr_config
    def getPostingConfig(self, parent_trace, kind, manifest_nb):
        '''
        Return a PostingConfig, corresponding to the configuration that this concrete controller supports.
        '''
        ME = CapabilityHierarchy_Controller
        update_policy = UpdatePolicy(reuse_uids=True, merge=False)
        xlr_config = ME._MyPostingConfig(update_policy=update_policy,
                                         kind=kind,
                                         manifest_nb=manifest_nb,
                                         controller=self)

        return xlr_config
예제 #5
0
    def getPostingConfig(self, parent_trace, kind, manifest_nb):
        '''
        Return a PostingConfig, corresponding to the configuration that this concrete controller supports.
        '''
        ME                              = ProductsController
        if kind == 'product':
            update_policy               = UpdatePolicy(reuse_uids=True, merge=False)
            xlr_config                  = ME._ProductConfig(    kind            = kind, 
                                                                update_policy   = update_policy,
                                                                manifest_nb     = manifest_nb, 
                                                                controller      = self)
        elif kind == 'line-of-business':
            update_policy               = UpdatePolicy(reuse_uids=True, merge=False)
            xlr_config                  = StaticData_Controller._StaticDataConfig(  kind            = kind, 
                                                                                    update_policy   = update_policy,
                                                                                    manifest_nb     = manifest_nb, 
                                                                                    controller      = self)
        else:
            raise ApodeixiError(parent_trace, "Invalid domain object '" + kind + "' - should be one of "
                                                + ", ".join(self.SUPPORTED_KINDS),
                                                origination = {'signaled_from': __file__})

        return xlr_config