Exemple #1
0
    def test_handle_create_game(self):
        exporter1 = LoggingExporter(None)
        exporter2 = LoggingExporter(None)

        composite_exporter = CompositeExporter(None, [exporter1, exporter2])
        composite_exporter.handle_create_game(None)

        assert exporter1.handle_create_game_calls == 1
        assert exporter2.handle_create_game_calls == 1
Exemple #2
0
    def test_handle_change_entity(self):
        exporter1 = LoggingExporter(None)
        exporter2 = LoggingExporter(None)

        composite_exporter = CompositeExporter(None, [exporter1, exporter2])
        composite_exporter.handle_change_entity(None)

        assert exporter1.handle_change_entity_calls == 1
        assert exporter2.handle_change_entity_calls == 1
Exemple #3
0
    def test_handle_cached_tag_for_dormant_change(self):
        exporter1 = LoggingExporter(None)
        exporter2 = LoggingExporter(None)

        composite_exporter = CompositeExporter(None, [exporter1, exporter2])
        composite_exporter.handle_cached_tag_for_dormant_change(None)

        assert exporter1.handle_cached_tag_for_dormant_change_calls == 1
        assert exporter2.handle_cached_tag_for_dormant_change_calls == 1
Exemple #4
0
    def test_flush(self):
        exporter1 = LoggingExporter(None)
        exporter2 = LoggingExporter(None)

        composite_exporter = CompositeExporter(None, [exporter1, exporter2])
        composite_exporter.flush()

        assert exporter1.flush_calls == 1
        assert exporter2.flush_calls == 1
Exemple #5
0
    def test_handle_block(self):
        exporter1 = LoggingExporter(None)
        exporter2 = LoggingExporter(None)

        composite_exporter = CompositeExporter(None, [exporter1, exporter2])
        composite_exporter.handle_block(
            Block(time.time(), 0, 0, 0, 0, 0, 0, 0, 0))

        assert exporter1.handle_block_calls == 1
        assert exporter2.handle_block_calls == 1