Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_listen_to_notifications_then_stop():
api = API(Client(port=7128))
api.listen_to_notifications(threaded=True, timeout=1)
api.stop_listening()
assert api.listener is None
def test_eq_method(self):
assert self.download == Download(API(), {"gid": "0a6635c602761000"})
def test_init_method(self):
assert Download(API(), {})
command.append(f"--input-file={session_path}")
else:
if not session.exists():
raise ValueError(f"no such session: {session}")
command.append(f"--input-file={session}")
if secret:
command.append(f"--rpc-secret={secret}")
self.command = command
self.process = None
# create the client with port
self.client = aria2p.Client(port=self.port, secret=secret)
# create the API instance
self.api = aria2p.API(self.client)
def setup_method(self):
self.api = API()
self.api.set_global_options = lambda x: True
self.options = Options(self.api, {})
def setup_method(self):
self.bitfield = (
"9e7ef5fbdefdffffdfffffffffffffdf7fff5dfefff7feffefffdff7fffffffbfeffbffddf7de9f7eefffffffeffe77bb"
"f8fdbdcffef7fffffbefad7ffffffbf55bff7edfedfeff7ffff7ffffff3ffff7d3ffbfffddddffe7ffffffffffdedf7fd"
"fef62fbdfffffbffbffdcfaffffafebeff3ebff7d5fffbbb2bafef77ffaffe7d37fbffffffb6dfffffffedfebbecbbffe"
"bdefffffffff977f7ffdffee7fffffffdfeb3f67dddffeedfffffbfffffdaffbfeedfadef6dfd9d2df9fb7f689ffcff3f"
"fbfebbfdbd7fcddfa77dfddffdfe327fdcbf77fad87ffff6ff7ffebfefdfbbffdefdafeefed7fefffe7ffad9ffdcffefc"
"ffbbf3c07ef7fc0"
)
self.download = Download(
API(),
{
"bitfield": self.bitfield,
"bittorrent": {},
"completedLength": "889592532",
"connections": "44",
"dir": "/home/pawamoy/Downloads/torrents/tmp",
"downloadSpeed": "745509",
"files": [
{
"completedLength": "58132",
"index": "1",
"length": "58132",
"path": "/home/pawamoy/Downloads/torrents/tmp/dl/logo.jpg",
"selected": "true",
"uris": [],
},
def setup_method(self):
self.api = API()