-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests
- Loading branch information
Showing
12 changed files
with
34 additions
and
31 deletions.
There are no files selected for viewing
File renamed without changes.
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
23 changes: 23 additions & 0 deletions
23
...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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from unittest.mock import patch | ||
|
||
from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent | ||
from tribler_core.components.base import Session | ||
from tribler_core.components.ipv8 import Ipv8Component | ||
from tribler_core.components.masterkey import MasterKeyComponent | ||
from tribler_core.components.restapi import RESTComponent | ||
from tribler_core.restapi.rest_manager import RESTManager | ||
|
||
|
||
async def test_bandwidth_accounting_component(tribler_config): | ||
components = [RESTComponent(), MasterKeyComponent(), Ipv8Component(), BandwidthAccountingComponent()] | ||
session = Session(tribler_config, components) | ||
with session: | ||
comp = BandwidthAccountingComponent.instance() | ||
with patch.object(RESTManager, 'get_endpoint'): | ||
await session.start() | ||
|
||
assert comp.community | ||
assert comp._rest_manager | ||
assert comp._ipv8 | ||
|
||
await session.shutdown() |
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
3 changes: 1 addition & 2 deletions
3
src/tribler-core/tribler_core/modules/tests/bandwidth_accounting/test_transaction.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