Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/auto open default value #500

Merged
merged 3 commits into from
Sep 6, 2024
Merged
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: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pykiso"
version = "0.29.1"
version = "0.29.2"
description = "Embedded integration testing framework."
authors = ["Sebastian Fischer <sebastian.fischer@de.bosch.com>"]
license = "Eclipse Public License - v 2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/pykiso/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def close(self):
class CChannel(Connector):
"""Abstract class for coordination channel."""

def __init__(self, processing=False, auto_open: bool = True, **kwargs: dict) -> None:
def __init__(self, processing=False, auto_open: bool = False, **kwargs: dict) -> None:
"""Constructor.

:param processing: deprecated, will not be taken into account.
Expand Down
41 changes: 13 additions & 28 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@

pytest_plugins = ["pytester"]


## skip slow test by default
def pytest_addoption(parser):
parser.addoption(
"--runslow", action="store_true", default=False, help="run slow tests"
)
parser.addoption("--runslow", action="store_true", default=False, help="run slow tests")


def pytest_configure(config):
Expand All @@ -57,7 +56,9 @@ class TestConnector:
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
self.auto_open = False
self.auto_open = True
def open(self):
pass

class TestAux:
def __init__(self, com = None, *args, **kwargs):
Expand Down Expand Up @@ -203,39 +204,27 @@ def create_communication_pipeline(self, max_com):
self.auxiliaries[-1].create_instance()

def prepare_default_test_cases(self, param):
@define_test_parameters(
suite_id=param[0], case_id=param[1], aux_list=param[2]
)
@define_test_parameters(suite_id=param[0], case_id=param[1], aux_list=param[2])
class MyTestCase(test_case.BasicTest):
def test_run(self) -> None:
pass

self.suite.addTest(MyTestCase(methodName="test_run"))

def prepare_remote_test_cases(self, param):
@define_test_parameters(
suite_id=param[0], case_id=param[1], aux_list=param[2]
)
@define_test_parameters(suite_id=param[0], case_id=param[1], aux_list=param[2])
class MyTestCase(test_case.RemoteTest):
pass

self.suite.addTest(MyTestCase("test_run"))

def prepare_default_test_suites(
self, modules_to_add_dir, test_filter_pattern, test_suite_id
):
def prepare_default_test_suites(self, modules_to_add_dir, test_filter_pattern, test_suite_id):
class MyTestSuite(test_suite.BasicTestSuite):
def __init__(
self, modules_to_add_dir, test_filter_pattern, test_suite_id
):
super(MyTestSuite, self).__init__(
modules_to_add_dir, test_filter_pattern, test_suite_id
)
def __init__(self, modules_to_add_dir, test_filter_pattern, test_suite_id):
super(MyTestSuite, self).__init__(modules_to_add_dir, test_filter_pattern, test_suite_id)

# Start integration test
self.custom_test_suite = MyTestSuite(
modules_to_add_dir, test_filter_pattern, test_suite_id
)
self.custom_test_suite = MyTestSuite(modules_to_add_dir, test_filter_pattern, test_suite_id)

def stop(self):
for aux in self.auxiliaries:
Expand Down Expand Up @@ -406,9 +395,7 @@ def cases_response():
def runs_response():
response = requests.Response()
response.status_code = 200
response._content = json.dumps(
{"offset": 0, "runs": [{"id": 1, "name": "..."}, {"id": 2, "name": "..."}]}
)
response._content = json.dumps({"offset": 0, "runs": [{"id": 1, "name": "..."}, {"id": 2, "name": "..."}]})
return response


Expand Down Expand Up @@ -446,9 +433,7 @@ def add_result_response():
def add_run_response():
response = requests.Response()
response.status_code = 200
response._content = json.dumps(
{"id": 1, "config": "Firefox, Ubuntu 12", "milestone_id": 1, "failed_count": 10}
)
response._content = json.dumps({"id": 1, "config": "Firefox, Ubuntu 12", "milestone_id": 1, "failed_count": 10})
return response


Expand Down
Loading