コード例 #1
0
    def setUp(self):
        config1 = get_data_source_with_related_doc_type()
        config1.save()
        config2 = get_data_source_with_related_doc_type()
        config2.table_id = 'other-config'
        config2.save()
        self.configs = [config1, config2]
        self.adapters = [get_indicator_adapter(c) for c in self.configs]

        # one pillow that has one config, the other has both configs
        self.pillow1 = _get_pillow([config1])
        self.pillow2 = _get_pillow(self.configs)

        self.pillow1.get_change_feed().get_latest_offsets()
コード例 #2
0
ファイル: test_pillow.py プロジェクト: kkrampa/commcare-hq
    def setUp(self):
        config1 = get_data_source_with_related_doc_type()
        config1.save()
        config2 = get_data_source_with_related_doc_type()
        config2.table_id = 'other-config'
        config2.save()
        self.configs = [config1, config2]
        self.adapters = [get_indicator_adapter(c) for c in self.configs]

        # one pillow that has one config, the other has both configs
        self.pillow1 = get_case_pillow(topics=['case-sql'], ucr_configs=[config1], processor_chunk_size=0)
        self.pillow2 = get_case_pillow(topics=['case-sql'], ucr_configs=self.configs, processor_chunk_size=0)

        self.pillow1.get_change_feed().get_latest_offsets()
コード例 #3
0
ファイル: test_pillow.py プロジェクト: dimagi/commcare-hq
    def setUp(self):
        config1 = get_data_source_with_related_doc_type()
        config1.save()
        config2 = get_data_source_with_related_doc_type()
        config2.table_id = 'other-config'
        config2.save()
        self.configs = [config1, config2]
        self.adapters = [get_indicator_adapter(c) for c in self.configs]

        # one pillow that has one config, the other has both configs
        self.pillow1 = _get_pillow([config1])
        self.pillow2 = _get_pillow(self.configs)

        self.pillow1.get_change_feed().get_latest_offsets()
コード例 #4
0
ファイル: test_pillow.py プロジェクト: lskdev/commcare-hq
    def setUp(self):
        config1 = get_data_source_with_related_doc_type()
        config1.save()
        config2 = get_data_source_with_related_doc_type()
        config2.table_id = 'other-config'
        config2.save()
        self.configs = [config1, config2]
        self.adapters = [get_indicator_adapter(c) for c in self.configs]

        # one pillow that has one config, the other has both configs
        self.pillow1 = get_case_pillow(topics=['case-sql'], ucr_configs=[config1], processor_chunk_size=0)
        self.pillow2 = get_case_pillow(topics=['case-sql'], ucr_configs=self.configs, processor_chunk_size=0)

        self.pillow1.get_change_feed().get_latest_offsets()
コード例 #5
0
ファイル: test_pillow.py プロジェクト: xbryanc/commcare-hq
    def setUp(self):
        config1 = get_data_source_with_related_doc_type()
        config1.save()
        config2 = get_data_source_with_related_doc_type()
        config2.table_id = 'other-config'
        config2.save()
        self.configs = [config1, config2]
        self.adapters = [get_indicator_adapter(c) for c in self.configs]

        # one pillow that has one config, the other has both configs
        self.pillow1 = get_kafka_ucr_pillow(topics=['case-sql'])
        self.pillow2 = get_kafka_ucr_pillow(topics=['case-sql'])
        self.pillow1.bootstrap(configs=[config1])
        self.pillow2.bootstrap(configs=self.configs)
        with trap_extra_setup(KafkaUnavailableError):
            self.pillow1.get_change_feed().get_latest_offsets()
コード例 #6
0
ファイル: test_pillow.py プロジェクト: kkrampa/commcare-hq
    def setUp(self):
        self.config = get_data_source_with_related_doc_type()
        self.config.save()
        self.pillow = get_case_pillow(topics=['case-sql'], ucr_configs=[self.config], processor_chunk_size=0)
        self.adapter = get_indicator_adapter(self.config)

        self.pillow.get_change_feed().get_latest_offsets()
コード例 #7
0
ファイル: test_pillow.py プロジェクト: lskdev/commcare-hq
    def setUp(self):
        self.config = get_data_source_with_related_doc_type()
        self.config.save()
        self.pillow = get_case_pillow(topics=['case-sql'], ucr_configs=[self.config], processor_chunk_size=0)
        self.adapter = get_indicator_adapter(self.config)

        self.pillow.get_change_feed().get_latest_offsets()
コード例 #8
0
ファイル: test_pillow.py プロジェクト: kkrampa/commcare-hq
 def setUpClass(cls):
     super(AsyncIndicatorTest, cls).setUpClass()
     cls.config = get_data_source_with_related_doc_type()
     cls.config.asynchronous = True
     cls.config.save()
     cls.adapter = get_indicator_adapter(cls.config)
     cls.pillow = get_case_pillow(ucr_configs=[cls.config])
     cls.pillow.get_change_feed().get_latest_offsets()
コード例 #9
0
 def setUpClass(cls):
     super(AsyncIndicatorTest, cls).setUpClass()
     cls.config = get_data_source_with_related_doc_type()
     cls.config.asynchronous = True
     cls.config.save()
     cls.adapter = get_indicator_adapter(cls.config)
     cls.pillow = _get_pillow([cls.config])
     cls.pillow.get_change_feed().get_latest_offsets()
コード例 #10
0
ファイル: test_pillow.py プロジェクト: xbryanc/commcare-hq
    def setUp(self):
        self.pillow = get_kafka_ucr_pillow(topics=['case-sql'])
        self.config = get_data_source_with_related_doc_type()
        self.config.save()
        self.adapter = get_indicator_adapter(self.config)

        self.pillow.bootstrap(configs=[self.config])
        with trap_extra_setup(KafkaUnavailableError):
            self.pillow.get_change_feed().get_latest_offsets()
コード例 #11
0
ファイル: test_pillow.py プロジェクト: xbryanc/commcare-hq
    def setUpClass(cls):
        super(AsyncIndicatorTest, cls).setUpClass()
        cls.pillow = get_kafka_ucr_pillow()
        cls.config = get_data_source_with_related_doc_type()
        cls.config.asynchronous = True
        cls.config.save()
        cls.adapter = get_indicator_adapter(cls.config)

        cls.pillow.bootstrap(configs=[cls.config])
        with trap_extra_setup(KafkaUnavailableError):
            cls.pillow.get_change_feed().get_latest_offsets()
コード例 #12
0
ファイル: test_pillow.py プロジェクト: dimagi/commcare-hq
 def setUp(self):
     self.config = get_data_source_with_related_doc_type()
     self.config.save()
     self.adapter = get_indicator_adapter(self.config)
     self.pillow = _get_pillow([self.config])
     self.pillow.get_change_feed().get_latest_offsets()
コード例 #13
0
 def setUp(self):
     self.config = get_data_source_with_related_doc_type()
     self.config.save()
     self.adapter = get_indicator_adapter(self.config)
     self.pillow = _get_pillow([self.config])
     self.pillow.get_change_feed().get_latest_offsets()