Add support for Connectors #295
11 fail, 1 skipped, 147 pass in 1m 1s
Annotations
Check warning on line 0 in tests.connectors.test_connector
github-actions / Test Results
test_push_event_to_intake_with_2_events (tests.connectors.test_connector) failed
junit.xml [took 0s]
Raw output
AttributeError: 'dict' object has no attribute 'intake_server'
test_connector = <tests.connectors.test_connector.DummyConnector object at 0x7f8c9cec6550>
mocked_trigger_logs = <requests_mock.mocker.Mocker object at 0x7f8c9c665950>
def test_push_event_to_intake_with_2_events(test_connector, mocked_trigger_logs):
url = "https://intake.sekoia.io/batch"
mocked_trigger_logs.post(url, json={"event_ids": ["001", "002"]})
> result = test_connector.push_events_to_intakes(EVENTS)
tests/connectors/test_connector.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.connectors.test_connector.DummyConnector object at 0x7f8c9cec6550>
events = ['foo', 'bar'], sync = False
def push_events_to_intakes(
self, events: list[str], sync: bool = False
) -> list[str]:
"""
Push events to intakes.
Args:
events: list[str]
sync: bool
Returns:
list[str]
"""
# no event to push
if not events:
return []
# Reset the consecutive error count
self._error_count = 0
self._last_events_time = datetime.utcnow()
> intake_host = os.getenv("INTAKE_URL", self.configuration.intake_server)
E AttributeError: 'dict' object has no attribute 'intake_server'
sekoia_automation/connector/__init__.py:150: AttributeError
Check warning on line 0 in tests.connectors.test_connector
github-actions / Test Results
test_push_event_to_intake_with_chunks (tests.connectors.test_connector) failed
junit.xml [took 0s]
Raw output
AttributeError: 'dict' object has no attribute 'intake_server'
test_connector = <tests.connectors.test_connector.DummyConnector object at 0x7f8ca1369090>
mocked_trigger_logs = <requests_mock.mocker.Mocker object at 0x7f8c9cdf5110>
def test_push_event_to_intake_with_chunks(test_connector, mocked_trigger_logs):
url = "https://intake.sekoia.io/batch"
mocked_trigger_logs.post(
url, json={"event_ids": ["001"]}, additional_matcher=match_events("foo")
)
mocked_trigger_logs.post(
url, json={"event_ids": ["002"]}, additional_matcher=match_events("bar")
)
mocked_trigger_logs.post(
url, json={"event_ids": ["003"]}, additional_matcher=match_events("baz")
)
mocked_trigger_logs.post(
url, json={"event_ids": ["004"]}, additional_matcher=match_events("oof")
)
with patch("sekoia_automation.connector.CHUNK_BYTES_MAX_SIZE", 4): # len("foo") + 1
> result = test_connector.push_events_to_intakes(["foo", "bar", "baz", "oof"])
tests/connectors/test_connector.py:117:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.connectors.test_connector.DummyConnector object at 0x7f8ca1369090>
events = ['foo', 'bar', 'baz', 'oof'], sync = False
def push_events_to_intakes(
self, events: list[str], sync: bool = False
) -> list[str]:
"""
Push events to intakes.
Args:
events: list[str]
sync: bool
Returns:
list[str]
"""
# no event to push
if not events:
return []
# Reset the consecutive error count
self._error_count = 0
self._last_events_time = datetime.utcnow()
> intake_host = os.getenv("INTAKE_URL", self.configuration.intake_server)
E AttributeError: 'dict' object has no attribute 'intake_server'
sekoia_automation/connector/__init__.py:150: AttributeError
Check warning on line 0 in tests.connectors.test_connector
github-actions / Test Results
test_push_event_to_intake_with_chunks_executor_stopped (tests.connectors.test_connector) failed
junit.xml [took 0s]
Raw output
AttributeError: 'dict' object has no attribute 'intake_server'
test_connector = <tests.connectors.test_connector.DummyConnector object at 0x7f8c9c68ba10>
mocked_trigger_logs = <requests_mock.mocker.Mocker object at 0x7f8c9cd29cd0>
def test_push_event_to_intake_with_chunks_executor_stopped(
test_connector, mocked_trigger_logs
):
test_connector.stop()
url = "https://intake.sekoia.io/batch"
mocked_trigger_logs.post(
url, json={"event_ids": ["001"]}, additional_matcher=match_events("foo")
)
mocked_trigger_logs.post(
url, json={"event_ids": ["002"]}, additional_matcher=match_events("bar")
)
mocked_trigger_logs.post(
url, json={"event_ids": ["003"]}, additional_matcher=match_events("baz")
)
mocked_trigger_logs.post(
url, json={"event_ids": ["004"]}, additional_matcher=match_events("oof")
)
with patch("sekoia_automation.connector.CHUNK_BYTES_MAX_SIZE", 4): # len("foo") + 1
> result = test_connector.push_events_to_intakes(["foo", "bar", "baz", "oof"])
tests/connectors/test_connector.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.connectors.test_connector.DummyConnector object at 0x7f8c9c68ba10>
events = ['foo', 'bar', 'baz', 'oof'], sync = False
def push_events_to_intakes(
self, events: list[str], sync: bool = False
) -> list[str]:
"""
Push events to intakes.
Args:
events: list[str]
sync: bool
Returns:
list[str]
"""
# no event to push
if not events:
return []
# Reset the consecutive error count
self._error_count = 0
self._last_events_time = datetime.utcnow()
> intake_host = os.getenv("INTAKE_URL", self.configuration.intake_server)
E AttributeError: 'dict' object has no attribute 'intake_server'
sekoia_automation/connector/__init__.py:150: AttributeError
Check warning on line 0 in tests.connectors.test_connector
github-actions / Test Results
test_push_events_to_intakes_api_failed (tests.connectors.test_connector) failed
junit.xml [took 0s]
Raw output
AttributeError: 'dict' object has no attribute 'intake_server'
test_connector = <tests.connectors.test_connector.DummyConnector object at 0x7f8ca138e590>
mocked_trigger_logs = <requests_mock.mocker.Mocker object at 0x7f8c9c48e0d0>
def test_push_events_to_intakes_api_failed(test_connector, mocked_trigger_logs):
url = "https://intake.sekoia.io/batch"
mocked_trigger_logs.post(url, status_code=504)
test_connector._retry = lambda: Retrying(
reraise=True,
stop=stop_after_attempt(1),
)
> result = test_connector.push_events_to_intakes(EVENTS)
tests/connectors/test_connector.py:162:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.connectors.test_connector.DummyConnector object at 0x7f8ca138e590>
events = ['foo', 'bar'], sync = False
def push_events_to_intakes(
self, events: list[str], sync: bool = False
) -> list[str]:
"""
Push events to intakes.
Args:
events: list[str]
sync: bool
Returns:
list[str]
"""
# no event to push
if not events:
return []
# Reset the consecutive error count
self._error_count = 0
self._last_events_time = datetime.utcnow()
> intake_host = os.getenv("INTAKE_URL", self.configuration.intake_server)
E AttributeError: 'dict' object has no attribute 'intake_server'
sekoia_automation/connector/__init__.py:150: AttributeError
Check warning on line 0 in tests.connectors.test_connector
github-actions / Test Results
test_push_events_to_intakes_api_failed_retried (tests.connectors.test_connector) failed
junit.xml [took 0s]
Raw output
AttributeError: 'dict' object has no attribute 'intake_server'
test_connector = <tests.connectors.test_connector.DummyConnector object at 0x7f8c9c779f10>
mocked_trigger_logs = <requests_mock.mocker.Mocker object at 0x7f8c9c43c810>
def test_push_events_to_intakes_api_failed_retried(test_connector, mocked_trigger_logs):
url = "https://intake.sekoia.io/batch"
mocked_trigger_logs.post(
url,
[
{"status_code": 504},
{"json": {"event_ids": ["001", "002"]}, "status_code": 200},
],
)
test_connector._retry = lambda: Retrying(
reraise=True, stop=stop_after_attempt(5), wait=wait_none()
)
> result = test_connector.push_events_to_intakes(EVENTS)
tests/connectors/test_connector.py:178:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.connectors.test_connector.DummyConnector object at 0x7f8c9c779f10>
events = ['foo', 'bar'], sync = False
def push_events_to_intakes(
self, events: list[str], sync: bool = False
) -> list[str]:
"""
Push events to intakes.
Args:
events: list[str]
sync: bool
Returns:
list[str]
"""
# no event to push
if not events:
return []
# Reset the consecutive error count
self._error_count = 0
self._last_events_time = datetime.utcnow()
> intake_host = os.getenv("INTAKE_URL", self.configuration.intake_server)
E AttributeError: 'dict' object has no attribute 'intake_server'
sekoia_automation/connector/__init__.py:150: AttributeError
Check warning on line 0 in tests.connectors.test_connector
github-actions / Test Results
test_push_events_to_intake_invalid_intake_key (tests.connectors.test_connector) failed
junit.xml [took 0s]
Raw output
Failed: DID NOT RAISE <class 'sekoia_automation.exceptions.TriggerConfigurationError'>
test_connector = <tests.connectors.test_connector.DummyConnector object at 0x7f8c9c4a6fd0>
def test_push_events_to_intake_invalid_intake_key(test_connector):
> with pytest.raises(TriggerConfigurationError):
E Failed: DID NOT RAISE <class 'sekoia_automation.exceptions.TriggerConfigurationError'>
tests/connectors/test_connector.py:183: Failed
Check warning on line 0 in tests.connectors.test_connector
github-actions / Test Results
test_query_exception_api (tests.connectors.test_connector) failed
junit.xml [took 0s]
Raw output
AttributeError: 'dict' object has no attribute 'intake_server'
test_connector = <tests.connectors.test_connector.DummyConnector object at 0x7f8ca1faaad0>
requests_mock = <requests_mock.mocker.Mocker object at 0x7f8c9c42ae50>
def test_query_exception_api(test_connector, requests_mock):
requests_mock.post(
"https://intake.sekoia.io/batch",
[
{"exc": Exception},
{"json": {"event_ids": ["001", "002"]}},
],
)
test_connector._retry = lambda: Retrying(reraise=True)
> assert test_connector.push_events_to_intakes(EVENTS) == ["001", "002"]
tests/connectors/test_connector.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.connectors.test_connector.DummyConnector object at 0x7f8ca1faaad0>
events = ['foo', 'bar'], sync = False
def push_events_to_intakes(
self, events: list[str], sync: bool = False
) -> list[str]:
"""
Push events to intakes.
Args:
events: list[str]
sync: bool
Returns:
list[str]
"""
# no event to push
if not events:
return []
# Reset the consecutive error count
self._error_count = 0
self._last_events_time = datetime.utcnow()
> intake_host = os.getenv("INTAKE_URL", self.configuration.intake_server)
E AttributeError: 'dict' object has no attribute 'intake_server'
sekoia_automation/connector/__init__.py:150: AttributeError
Check warning on line 0 in tests.scripts.test_sync_library
github-actions / Test Results
test_no_module_success (tests.scripts.test_sync_library) failed
junit.xml [took 0s]
Raw output
assert 6 == 8
+ where 6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0311c50>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca2bc2790>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f89b50>])
module = {'configuration': {}, 'description': 'TBD', 'docker': 'sekoia-automation-module-sample', 'name': 'Test Module', ...}
action = {'arguments': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'data': {'description': 'The ...t a specified URL and returns the response as Raw or JSON', 'docker_parameters': 'request', 'name': 'Request URL', ...}
trigger = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'C...Alert was created in the Operation Center', 'docker_parameters': 'alert_created_trigger', 'name': 'Alert Created', ...}
connector = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'S...: 'object'}, 'description': 'Sekoia: connecting... things', 'docker_parameters': 'connector', 'name': 'Connector', ...}
kwargs = {'m': <requests_mock.mocker.Mocker object at 0x7f8ca0bd9fd0>}
sync_lib = <sekoia_automation.scripts.sync_library.SyncLibrary object at 0x7f8ca2b01050>
history = [<requests_mock.request._RequestObjectProxy object at 0x7f8ca0311c50>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca2bc2790>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f89b50>]
@py_assert2 = 6, @py_assert5 = 8, @py_assert4 = False
@py_format7 = '6\n{6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0311c50>, <requests_mock.request._RequestObj...tObjectProxy object at 0x7f8ca2bc2790>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f89b50>])\n} == 8'
@py_format9 = 'assert 6\n{6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0311c50>, <requests_mock.request._Req...tObjectProxy object at 0x7f8ca2bc2790>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f89b50>])\n} == 8'
@requests_mock.Mocker(kw="m")
def test_no_module_success(module, action, trigger, connector, **kwargs):
kwargs["m"].register_uri(
"GET", re.compile(f"{SYMPOHNY_URL}.*"), status_code=200, json={}
)
kwargs["m"].register_uri("PATCH", re.compile(f"{SYMPOHNY_URL}.*"))
sync_lib = SyncLibrary(SYMPOHNY_URL, API_KEY, Path("tests/data"))
sync_lib.execute()
history = kwargs["m"].request_history
> assert len(history) == 8
E assert 6 == 8
E + where 6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0311c50>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca2bc2790>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f89b50>])
tests/scripts/test_sync_library.py:57: AssertionError
Check warning on line 0 in tests.scripts.test_sync_library
github-actions / Test Results
test_no_module_404 (tests.scripts.test_sync_library) failed
junit.xml [took 0s]
Raw output
assert 6 == 8
+ where 6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0380150>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca1760950>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca079cb50>])
module = {'configuration': {}, 'description': 'TBD', 'docker': 'sekoia-automation-module-sample', 'name': 'Test Module', ...}
action = {'arguments': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'data': {'description': 'The ...t a specified URL and returns the response as Raw or JSON', 'docker_parameters': 'request', 'name': 'Request URL', ...}
trigger = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'C...Alert was created in the Operation Center', 'docker_parameters': 'alert_created_trigger', 'name': 'Alert Created', ...}
connector = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'S...: 'object'}, 'description': 'Sekoia: connecting... things', 'docker_parameters': 'connector', 'name': 'Connector', ...}
kwargs = {'m': <requests_mock.mocker.Mocker object at 0x7f8ca33e9910>}
sync_lib = <sekoia_automation.scripts.sync_library.SyncLibrary object at 0x7f8ca1ff7bd0>
history = [<requests_mock.request._RequestObjectProxy object at 0x7f8ca0380150>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca1760950>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca079cb50>]
@py_assert2 = 6, @py_assert5 = 8, @py_assert4 = False
@py_format7 = '6\n{6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0380150>, <requests_mock.request._RequestObj...tObjectProxy object at 0x7f8ca1760950>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca079cb50>])\n} == 8'
@py_format9 = 'assert 6\n{6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0380150>, <requests_mock.request._Req...tObjectProxy object at 0x7f8ca1760950>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca079cb50>])\n} == 8'
@requests_mock.Mocker(kw="m")
def test_no_module_404(module, action, trigger, connector, **kwargs):
kwargs["m"].register_uri(
"GET", re.compile(f"{SYMPOHNY_URL}.*"), status_code=404, json={}
)
kwargs["m"].register_uri("POST", re.compile(f"{SYMPOHNY_URL}.*"))
sync_lib = SyncLibrary(SYMPOHNY_URL, API_KEY, Path("tests/data"))
sync_lib.execute()
history = kwargs["m"].request_history
> assert len(history) == 8
E assert 6 == 8
E + where 6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca0380150>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca1760950>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca079cb50>])
tests/scripts/test_sync_library.py:94: AssertionError
Check warning on line 0 in tests.scripts.test_sync_library
github-actions / Test Results
test_no_module_other_code (tests.scripts.test_sync_library) failed
junit.xml [took 0s]
Raw output
assert 3 == 4
+ where 3 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8c9c3e0d90>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca2fba690>, <requests_mock.request._RequestObjectProxy object at 0x7f8c9c370950>])
module = {'configuration': {}, 'description': 'TBD', 'docker': 'sekoia-automation-module-sample', 'name': 'Test Module', ...}
action = {'arguments': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'data': {'description': 'The ...t a specified URL and returns the response as Raw or JSON', 'docker_parameters': 'request', 'name': 'Request URL', ...}
trigger = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'C...Alert was created in the Operation Center', 'docker_parameters': 'alert_created_trigger', 'name': 'Alert Created', ...}
connector = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'S...: 'object'}, 'description': 'Sekoia: connecting... things', 'docker_parameters': 'connector', 'name': 'Connector', ...}
kwargs = {'m': <requests_mock.mocker.Mocker object at 0x7f8ca0397190>}
sync_lib = <sekoia_automation.scripts.sync_library.SyncLibrary object at 0x7f8ca0f88990>
history = [<requests_mock.request._RequestObjectProxy object at 0x7f8c9c3e0d90>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca2fba690>, <requests_mock.request._RequestObjectProxy object at 0x7f8c9c370950>]
@py_assert2 = 3, @py_assert5 = 4, @py_assert4 = False
@py_format7 = '3\n{3 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8c9c3e0d90>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca2fba690>, <requests_mock.request._RequestObjectProxy object at 0x7f8c9c370950>])\n} == 4'
@py_format9 = 'assert 3\n{3 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8c9c3e0d90>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca2fba690>, <requests_mock.request._RequestObjectProxy object at 0x7f8c9c370950>])\n} == 4'
@requests_mock.Mocker(kw="m")
def test_no_module_other_code(module, action, trigger, connector, **kwargs):
kwargs["m"].register_uri(
"GET", re.compile(f"{SYMPOHNY_URL}.*"), status_code=418, json={}
)
kwargs["m"].register_uri("POST", re.compile(f"{SYMPOHNY_URL}.*"))
sync_lib = SyncLibrary(SYMPOHNY_URL, API_KEY, Path("tests/data"))
sync_lib.execute()
history = kwargs["m"].request_history
> assert len(history) == 4
E assert 3 == 4
E + where 3 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8c9c3e0d90>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca2fba690>, <requests_mock.request._RequestObjectProxy object at 0x7f8c9c370950>])
tests/scripts/test_sync_library.py:131: AssertionError
Check warning on line 0 in tests.scripts.test_sync_library
github-actions / Test Results
test_with_module (tests.scripts.test_sync_library) failed
junit.xml [took 0s]
Raw output
assert 6 == 8
+ where 6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca3386290>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca33862d0>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f1b910>])
module = {'configuration': {}, 'description': 'TBD', 'docker': 'sekoia-automation-module-sample', 'name': 'Test Module', ...}
action = {'arguments': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'data': {'description': 'The ...t a specified URL and returns the response as Raw or JSON', 'docker_parameters': 'request', 'name': 'Request URL', ...}
trigger = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'C...Alert was created in the Operation Center', 'docker_parameters': 'alert_created_trigger', 'name': 'Alert Created', ...}
connector = {'arguments': {'$schema': 'https://json-schema.org/draft-07/schema#', 'properties': {'rule_filter': {'description': 'S...: 'object'}, 'description': 'Sekoia: connecting... things', 'docker_parameters': 'connector', 'name': 'Connector', ...}
kwargs = {'m': <requests_mock.mocker.Mocker object at 0x7f8c9fb4fa10>}
sync_lib = <sekoia_automation.scripts.sync_library.SyncLibrary object at 0x7f8c9fb4c190>
history = [<requests_mock.request._RequestObjectProxy object at 0x7f8ca3386290>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca33862d0>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f1b910>]
@py_assert2 = 6, @py_assert5 = 8, @py_assert4 = False
@py_format7 = '6\n{6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca3386290>, <requests_mock.request._RequestObj...tObjectProxy object at 0x7f8ca33862d0>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f1b910>])\n} == 8'
@py_format9 = 'assert 6\n{6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca3386290>, <requests_mock.request._Req...tObjectProxy object at 0x7f8ca33862d0>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f1b910>])\n} == 8'
@requests_mock.Mocker(kw="m")
def test_with_module(module, action, trigger, connector, **kwargs):
kwargs["m"].register_uri(
"GET", re.compile(f"{SYMPOHNY_URL}.*"), status_code=200, json={}
)
kwargs["m"].register_uri("PATCH", re.compile(f"{SYMPOHNY_URL}.*"))
sync_lib = SyncLibrary(
SYMPOHNY_URL, API_KEY, Path("tests/data"), module="sample_module"
)
sync_lib.execute()
history = kwargs["m"].request_history
> assert len(history) == 8
E assert 6 == 8
E + where 6 = len([<requests_mock.request._RequestObjectProxy object at 0x7f8ca3386290>, <requests_mock.request._RequestObjectProxy obje...st._RequestObjectProxy object at 0x7f8ca33862d0>, <requests_mock.request._RequestObjectProxy object at 0x7f8ca0f1b910>])
tests/scripts/test_sync_library.py:158: AssertionError
Check notice on line 0 in .github
github-actions / Test Results
1 skipped test found
There is 1 skipped test, see "Raw output" for the name of the skipped test.
Raw output
tests.test_storage ‑ test_get_data_path_for_remote_storage
Check notice on line 0 in .github
github-actions / Test Results
159 tests found
There are 159 tests, see "Raw output" for the full list of tests.
Raw output
tests.aio.helpers.http.test_http_client_session ‑ test_http_client_get_data
tests.aio.helpers.http.test_http_client_session ‑ test_http_client_get_data_async_limiter
tests.aio.helpers.http.test_http_token_refresher ‑ test_token_refresher_1
tests.aio.helpers.http.test_http_token_refresher ‑ test_token_refresher_2
tests.aio.helpers.http.test_http_token_refresher ‑ test_token_refresher_with_token
tests.aio.helpers.http.test_http_utils ‑ test_save_response_to_temporary_file
tests.aio.helpers.test_aws ‑ test_aws_client_get_session
tests.aio.helpers.test_aws ‑ test_aws_client_init
tests.aio.helpers.test_file_utils ‑ test_csv_file_content
tests.aio.helpers.test_file_utils ‑ test_delete_file
tests.aio.test_connector ‑ test_async_connector_client_session
tests.aio.test_connector ‑ test_async_connector_push_multiple_events
tests.aio.test_connector ‑ test_async_connector_push_single_event
tests.aio.test_connector ‑ test_async_connector_raise_error
tests.aio.test_connector ‑ test_async_connector_rate_limiter
tests.connectors.test_connector ‑ test_chunk_events
tests.connectors.test_connector ‑ test_chunk_events_discard_too_long_message
tests.connectors.test_connector ‑ test_chunk_events_exceed_size
tests.connectors.test_connector ‑ test_forward_events
tests.connectors.test_connector ‑ test_push_event_to_intake_with_2_events
tests.connectors.test_connector ‑ test_push_event_to_intake_with_chunks
tests.connectors.test_connector ‑ test_push_event_to_intake_with_chunks_executor_stopped
tests.connectors.test_connector ‑ test_push_events_to_intake_invalid_intake_key
tests.connectors.test_connector ‑ test_push_events_to_intakes_api_failed
tests.connectors.test_connector ‑ test_push_events_to_intakes_api_failed_retried
tests.connectors.test_connector ‑ test_push_events_to_intakes_no_events
tests.connectors.test_connector ‑ test_query_exception_api
tests.connectors.test_connector ‑ test_send_records
tests.connectors.test_connector ‑ test_send_records_to_file
tests.connectors.test_workers ‑ test_create_workers
tests.connectors.test_workers ‑ test_start_workers
tests.connectors.test_workers ‑ test_stop_worker
tests.connectors.test_workers ‑ test_stop_workers
tests.connectors.test_workers ‑ test_supervise_workers
tests.loguru.test_loguru_config ‑ test_config_assemble_log_lvl
tests.loguru.test_loguru_config ‑ test_config_default_values
tests.loguru.test_loguru_formatters ‑ test_formatted_record_empty
tests.loguru.test_loguru_formatters ‑ test_formatted_record_non_empty
tests.loguru.test_loguru_handler ‑ test_logging_emit_with_existing_loguru_level
tests.loguru.test_loguru_handler ‑ test_logging_log_message
tests.metrics.test_prometheus_exporter ‑ test_prometheus_exporter
tests.scripts.test_files_generator ‑ test_files_generator
tests.scripts.test_files_generator ‑ test_files_generator_wrong_module_path
tests.scripts.test_sync_library ‑ test_get_module_docker_name
tests.scripts.test_sync_library ‑ test_get_module_logo
tests.scripts.test_sync_library ‑ test_load_module_docker_image_not_found
tests.scripts.test_sync_library ‑ test_no_module_404
tests.scripts.test_sync_library ‑ test_no_module_other_code
tests.scripts.test_sync_library ‑ test_no_module_success
tests.scripts.test_sync_library ‑ test_registry_check_custom_success
tests.scripts.test_sync_library ‑ test_registry_check_default_fail
tests.scripts.test_sync_library ‑ test_registry_check_default_success
tests.scripts.test_sync_library ‑ test_registry_check_not_found
tests.scripts.test_sync_library ‑ test_with_module
tests.scripts.test_sync_library ‑ test_with_module_invalid_name
tests.test_action ‑ test_action_error
tests.test_action ‑ test_action_execute_with_get_secrets
tests.test_action ‑ test_action_json_argument
tests.test_action ‑ test_action_json_argument_missing
tests.test_action ‑ test_action_json_result
tests.test_action ‑ test_action_json_result_same_as_argument
tests.test_action ‑ test_action_logs
tests.test_action ‑ test_action_outputs
tests.test_action ‑ test_action_results_invalid
tests.test_action ‑ test_action_results_with_secrets_update
tests.test_action ‑ test_action_send_result_client_error
tests.test_action ‑ test_action_send_result_conflict
tests.test_action ‑ test_action_with_arguments_model
tests.test_action ‑ test_action_with_results_model
tests.test_action ‑ test_add_secrets_dict
tests.test_action ‑ test_add_secrets_object
tests.test_action ‑ test_all
tests.test_action ‑ test_exception_handler
tests.test_action ‑ test_generic_api_action
tests.test_action ‑ test_validate_results_none
tests.test_cli ‑ test_generate_documentation
tests.test_cli ‑ test_generate_documentation_invalid_documentation_path
tests.test_cli ‑ test_generate_documentation_invalid_module_path
tests.test_cli ‑ test_generate_documentation_invalid_modules_path
tests.test_cli ‑ test_generate_documentation_specific_module
tests.test_cli ‑ test_new_module
tests.test_cli ‑ test_openapi_to_module
tests.test_cli ‑ test_openapi_to_module_no_title
tests.test_cli ‑ test_openapi_url_to_module
tests.test_cli ‑ test_synchronize_library
tests.test_cli ‑ test_update_sdk_version
tests.test_cli ‑ test_update_sdk_version_error
tests.test_config ‑ test_load_config_env
tests.test_config ‑ test_load_config_env_json
tests.test_config ‑ test_load_config_env_json_encoded
tests.test_config ‑ test_load_config_file
tests.test_config ‑ test_load_config_file_json
tests.test_config ‑ test_load_config_not_found_error
tests.test_config ‑ test_load_config_not_found_ok
tests.test_module ‑ test_abstract_module_item
tests.test_module ‑ test_command
tests.test_module ‑ test_command_no_arg
tests.test_module ‑ test_configuration_as_model
tests.test_module ‑ test_configuration_setter
tests.test_module ‑ test_configuration_setter_add_secret_not_required
tests.test_module ‑ test_configuration_setter_add_secret_required
tests.test_module ‑ test_configuration_setter_as_model
tests.test_module ‑ test_configuration_setter_missing_required_secret
tests.test_module ‑ test_load_config_file_not_exists
tests.test_module ‑ test_load_config_json
tests.test_module ‑ test_load_config_text
tests.test_module ‑ test_no_command
tests.test_module ‑ test_register_execute_command
tests.test_module ‑ test_register_execute_default
tests.test_module ‑ test_register_no_command
tests.test_storage ‑ test_get_data_path_for_local_storage
tests.test_storage ‑ test_get_data_path_for_local_storage_sub_folder
tests.test_storage ‑ test_get_data_path_for_remote_storage
tests.test_storage ‑ test_get_s3_data_path
tests.test_storage ‑ test_get_tls_client_credentials
tests.test_storage ‑ test_get_tls_client_credentials_not_set
tests.test_storage ‑ test_persistentjson
tests.test_storage ‑ test_temp_directory
tests.test_storage ‑ test_write_basic
tests.test_storage ‑ test_write_json
tests.test_storage ‑ test_write_temp
tests.test_trigger ‑ test_callback_url
tests.test_trigger ‑ test_configuration_errors_are_critical
tests.test_trigger ‑ test_get_secrets
tests.test_trigger ‑ test_is_error_critical_errors
tests.test_trigger ‑ test_is_error_critical_time_since_last_event
tests.test_trigger ‑ test_logs_url
tests.test_trigger ‑ test_module_community_uuid
tests.test_trigger ‑ test_module_configuration
tests.test_trigger ‑ test_secrets_url
tests.test_trigger ‑ test_send_event
tests.test_trigger ‑ test_send_event_4xx_error
tests.test_trigger ‑ test_send_event_too_many_failures
tests.test_trigger ‑ test_token
tests.test_trigger ‑ test_too_many_errors_critical_log
tests.test_trigger ‑ test_trigger_configuration
tests.test_trigger ‑ test_trigger_configuration_as_model
tests.test_trigger ‑ test_trigger_configuration_setter
tests.test_trigger ‑ test_trigger_directory
tests.test_trigger ‑ test_trigger_directory_does_not_exist
tests.test_trigger ‑ test_trigger_event_normalization
tests.test_trigger ‑ test_trigger_execute
tests.test_trigger ‑ test_trigger_liveness
tests.test_trigger ‑ test_trigger_liveness_error
tests.test_trigger ‑ test_trigger_liveness_not_found
tests.test_trigger ‑ test_trigger_log
tests.test_trigger ‑ test_trigger_log_batch_full
tests.test_trigger ‑ test_trigger_log_critical_only_once
tests.test_trigger ‑ test_trigger_log_retry
tests.test_trigger ‑ test_trigger_log_severity
tests.test_trigger ‑ test_trigger_log_time_elapsed
tests.test_trigger ‑ test_trigger_s3_client_error_int
tests.test_trigger ‑ test_trigger_s3_client_error_str
tests.test_trigger ‑ test_trigger_s3_connection_error
tests.test_trigger ‑ test_trigger_s3_server_error_int
tests.test_trigger ‑ test_trigger_s3_server_error_str
tests.test_trigger ‑ test_trigger_send_client_error
tests.test_trigger ‑ test_trigger_send_server_error
tests.test_trigger ‑ test_trigger_stop