Skip to content

Commit

Permalink
vdk-test-utils: make IngestIntoMemoryPlugin method configurable (#2783)
Browse files Browse the repository at this point in the history
IngestIntoMemoryPlugin is used in tests to mock ingestion targets.

It would be useful the method name to be configruable so it can be used
as different methods
  • Loading branch information
antoniivanov authored Oct 10, 2023
1 parent 371a518 commit fb384aa
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ class Payload:
target: Optional[str]
collection_id: Optional[str]

def __init__(self):
def __init__(self, method_name="memory"):
self.payloads: List[IngestIntoMemoryPlugin.Payload] = []
self.method_name = method_name

def ingest_payload(
self,
Expand All @@ -222,4 +223,4 @@ def ingest_payload(
def initialize_job(self, context: JobContext) -> None:
log.info("Initialize data job with IngestIntoMemory Plugin.")

context.ingester.add_ingester_factory_method("memory", lambda: self)
context.ingester.add_ingester_factory_method(self.method_name, lambda: self)

0 comments on commit fb384aa

Please sign in to comment.