How to use the aria2p.Options function in aria2p

To help you get started, we’ve selected a few aria2p examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pawamoy / aria2p / tests / test_options.py View on Github external
def test_are_not_global(self):
        options = Options(self.api, {}, Download(self.api, {}))
        assert not options.are_global
github pawamoy / aria2p / tests / test_options.py View on Github external
def test_set_method_for_download(self):
        self.api.set_options = lambda x, y: [True]
        options = Options(self.api, {}, Download(self.api, {}))
        assert options.set("0", 0)
        assert options.get("0") == "0"
github pawamoy / aria2p / tests / test_options.py View on Github external
def test_set_method(self):
        self.api.set_global_options = lambda x: True
        options = Options(self.api, {})
        assert options.set("0", 0)
        assert options.get("0") == "0"
        assert options.set(1, "1")
        assert options.get(1) == "1"
github pawamoy / aria2p / tests / test_options.py View on Github external
def test_get_struct_method(self):
        options = Options(self.api, {0: 1})
        assert options.get_struct() == {0: 1}
github pawamoy / aria2p / tests / test_options.py View on Github external
def test_are_global_method(self):
        options = Options(self.api, {})
        assert options.are_global
github pawamoy / aria2p / tests / test_options.py View on Github external
def test_init_method(self):
        assert Options(self.api, {})
github pawamoy / aria2p / tests / test_options.py View on Github external
def setup_method(self):
        self.api = API()
        self.api.set_global_options = lambda x: True
        self.options = Options(self.api, {})
github pawamoy / aria2p / tests / test_options.py View on Github external
def test_get_method(self):
        options = Options(self.api, {0: 1})
        assert options.get(0) == 1
github pawamoy / aria2p / tests / test_options.py View on Github external
def test_set_method_failure(self):
        self.api.set_global_options = lambda x: False
        options = Options(self.api, {"0": "0"})
        assert not options.set("0", "1")
        assert not options.set("1", "1")
        assert options.get("0") == "0"
        assert options.get("1") is None