-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6410 from drew2a/refactoring/merge_ipv8
Merge ipv8 module and component
- Loading branch information
Showing
19 changed files
with
66 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...tribler_core/components/bandwidth_accounting/tests/test_bandwidth_accounting_component.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
src/tribler-core/tribler_core/components/gigachannel/tests/test_gigachannel_component.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
49 changes: 49 additions & 0 deletions
49
src/tribler-core/tribler_core/components/ipv8/tests/test_ipv8_component.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import pytest | ||
|
||
from tribler_core.components.base import Session | ||
from tribler_core.components.ipv8.ipv8_component import Ipv8Component | ||
from tribler_core.components.masterkey.masterkey_component import MasterKeyComponent | ||
from tribler_core.components.restapi import RESTComponent | ||
|
||
pytestmark = pytest.mark.asyncio | ||
|
||
|
||
# pylint: disable=protected-access | ||
async def test_ipv8_component(tribler_config): | ||
tribler_config.ipv8.enabled = True | ||
session = Session(tribler_config, [MasterKeyComponent(), RESTComponent(), Ipv8Component()]) | ||
with session: | ||
await session.start() | ||
|
||
comp = Ipv8Component.instance() | ||
assert comp.started_event.is_set() and not comp.failed | ||
assert comp.ipv8 | ||
assert comp.peer | ||
assert not comp.dht_discovery_community | ||
assert comp._task_manager | ||
assert not comp._peer_discovery_community | ||
|
||
await session.shutdown() | ||
|
||
|
||
async def test_ipv8_component_dht_disabled(tribler_config): | ||
tribler_config.ipv8.enabled = True | ||
tribler_config.dht.enabled = True | ||
session = Session(tribler_config, [MasterKeyComponent(), RESTComponent(), Ipv8Component()]) | ||
with session: | ||
await session.start() | ||
|
||
comp = Ipv8Component.instance() | ||
assert comp.dht_discovery_community | ||
|
||
|
||
async def test_ipv8_component_discovery_community_enabled(tribler_config): | ||
tribler_config.ipv8.enabled = True | ||
tribler_config.gui_test_mode = False | ||
tribler_config.discovery_community.enabled = True | ||
session = Session(tribler_config, [MasterKeyComponent(), RESTComponent(), Ipv8Component()]) | ||
with session: | ||
await session.start() | ||
|
||
comp = Ipv8Component.instance() | ||
assert comp._peer_discovery_community |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters