mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-24 12:14:20 +01:00
fix test bug
This commit is contained in:
parent
a2b4f29643
commit
b9437052da
@ -7,14 +7,14 @@ from pirate.print import Printer
|
|||||||
|
|
||||||
class TestPrint(unittest.TestCase):
|
class TestPrint(unittest.TestCase):
|
||||||
|
|
||||||
def test_print_results(self):
|
def test_print_results_remote(self):
|
||||||
class MockTable:
|
class MockTable:
|
||||||
add_row = MagicMock()
|
add_row = MagicMock()
|
||||||
align = {}
|
align = {}
|
||||||
mock = MockTable()
|
mock = MockTable()
|
||||||
printer = Printer(False)
|
printer = Printer(False)
|
||||||
printer.print = MagicMock()
|
printer.print = MagicMock()
|
||||||
with patch('prettytable.PrettyTable', return_value=mock) as prettytable:
|
with patch('veryprettytable.VeryPrettyTable', return_value=mock) as prettytable:
|
||||||
results = [{
|
results = [{
|
||||||
'magnet': 'dn=name',
|
'magnet': 'dn=name',
|
||||||
'seeds': 1,
|
'seeds': 1,
|
||||||
@ -26,7 +26,7 @@ class TestPrint(unittest.TestCase):
|
|||||||
prettytable.assert_called_once_with(['LINK', 'SEED', 'LEECH', 'RATIO', 'SIZE', '', 'UPLOAD', 'NAME'])
|
prettytable.assert_called_once_with(['LINK', 'SEED', 'LEECH', 'RATIO', 'SIZE', '', 'UPLOAD', 'NAME'])
|
||||||
mock.add_row.assert_has_calls([call([0, 1, 2, '0.5', '3.0', 'MiB', 'never', 'name'])])
|
mock.add_row.assert_has_calls([call([0, 1, 2, '0.5', '3.0', 'MiB', 'never', 'name'])])
|
||||||
|
|
||||||
def test_print_results(self):
|
def test_print_results_local(self):
|
||||||
class MockTable:
|
class MockTable:
|
||||||
add_row = MagicMock()
|
add_row = MagicMock()
|
||||||
align = {}
|
align = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user