Skip to content

Commit

Permalink
Fix core and sync tests
Browse files Browse the repository at this point in the history
  • Loading branch information
badrogger committed Nov 26, 2024
1 parent fe34b64 commit 8b871ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions tests/cli/sync_node_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import mock
import logging

from node_cli.cli import __version__
from node_cli.configs import SKALE_DIR, NODE_DATA_PATH
from node_cli.core.node_options import NodeOptions
from node_cli.cli.sync_node import _init_sync, _update_sync
Expand All @@ -46,6 +47,7 @@ def test_init_sync(mocked_g_config):
result = run_command(_init_sync, ['./tests/test-env'])

node_options = NodeOptions()
print(node_options)
assert not node_options.archive
assert not node_options.catchup
assert not node_options.historic_state
Expand Down Expand Up @@ -110,6 +112,8 @@ def test_update_sync(mocked_g_config):
'node_cli.core.resources.get_disk_size', return_value=BIG_DISK_SIZE
), mock.patch('node_cli.core.node.configure_firewall_rules'), mock.patch(
'node_cli.utils.decorators.is_node_inited', return_value=True
), mock.patch(
'node_cli.core.node.get_meta_info', return_value={'version': __version__}
):
result = run_command(_update_sync, ['./tests/test-env', '--yes'])
assert result.exit_code == 0
8 changes: 4 additions & 4 deletions tests/core/core_node_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import pytest
import requests

from node_cli.cli import __version__

from node_cli.configs import NODE_DATA_PATH
from node_cli.configs.resource_allocation import RESOURCE_ALLOCATION_FILEPATH
from node_cli.core.node import BASE_CONTAINERS_AMOUNT, is_base_containers_alive
Expand Down Expand Up @@ -168,10 +170,8 @@ def test_update_node(mocked_g_config, resource_file):
'node_cli.utils.helper.post_request', resp_mock
), mock.patch('node_cli.core.resources.get_disk_size', return_value=BIG_DISK_SIZE), mock.patch(
'node_cli.core.host.init_data_dir'
):
with mock.patch(
'node_cli.utils.helper.requests.get', return_value=safe_update_api_response()
): # noqa
), mock.patch('node_cli.core.node.get_meta_info', return_value={'version': __version__}):
with mock.patch( 'node_cli.utils.helper.requests.get', return_value=safe_update_api_response()): # noqa
result = update(env_filepath, pull_config_for_schain=None)
assert result is None

Expand Down

0 comments on commit 8b871ba

Please sign in to comment.