def test_resumeTorrents_by_hashlist(): sut = QBitTorrent("admin", "adminadmin") sut.__POST__ = MagicMock(name="post") sut.resumeTorrents(hashes=["2", "3", "4"]) assert_that(sut.__POST__.call_count).is_equal_to(3)
def test_resumeTorrents_by_state(): sut = QBitTorrent("admin", "adminadmin") sut.__POST__ = MagicMock(name="post") sut.getTorrents = MagicMock(name="getTorrents") sut.getTorrents.return_value = [{"hash": "a"}, {"hash": "b"}, {"hash": "c"}] sut.resumeTorrents(state="downloading") sut.getTorrents.assert_called_with("downloading") assert_that(sut.__POST__.call_count).is_equal_to(3)
def test_resumeTorrents_by_state(): sut = QBitTorrent("admin", "adminadmin") sut.__POST__ = MagicMock(name="post") sut.getTorrents = MagicMock(name="getTorrents") sut.getTorrents.return_value = [{ "hash": "a" }, { "hash": "b" }, { "hash": "c" }] sut.resumeTorrents(state="downloading") sut.getTorrents.assert_called_with("downloading") assert_that(sut.__POST__.call_count).is_equal_to(3)