Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake
cmake-build-debug
venv
behave_venv

# Generated files
*flowfile_checkpoint
Expand Down
5 changes: 2 additions & 3 deletions behave_framework/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[project]
name = "minifi-test-framework"
version = "0.1.0"
version = "0.2.0"
requires-python = ">= 3.10"
description = "A testing framework for MiNiFi extensions."
dependencies = [
"behavex==4.6.0",
"docker==7.1.0",
"PyYAML==6.0.3",
"humanfriendly==10.0",
"m2crypto==0.46.2",
"pyopenssl==25.0.0",
"cryptography==46.0.5",
"pyjks==20.0.0"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import docker
from docker.models.networks import Network

from minifi_test_framework.containers.container_protocol import ContainerProtocol
from minifi_test_framework.containers.directory import Directory
from minifi_test_framework.containers.file import File
from minifi_test_framework.containers.host_file import HostFile
Expand All @@ -35,8 +36,9 @@
from minifi_test_framework.core.minifi_test_context import MinifiTestContext


class Container:
class LinuxContainer(ContainerProtocol):
def __init__(self, image_name: str, container_name: str, network: Network, command: str | None = None, entrypoint: str | None = None):
super().__init__()
self.image_name: str = image_name
self.container_name: str = container_name
self.network: Network = network
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import Protocol


class ContainerProtocol(Protocol):
def deploy(self, context) -> bool:
...

def clean_up(self):
...

def exec_run(self, command):
...

def directory_contains_file_with_content(self, directory_path: str, expected_content: str) -> bool:
...

def directory_contains_file_with_regex(self, directory_path: str, regex_str: str) -> bool:
...

def path_with_content_exists(self, path: str, content: str) -> bool:
...

def get_logs(self) -> str:
...

@property
def exited(self) -> bool:
...

def get_number_of_files(self, directory_path: str) -> int:
...

def verify_file_contents(self, directory_path: str, expected_contents: list[str]) -> bool:
...

def log_app_output(self) -> bool:
...
Loading
Loading