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_are_not_global(self):
options = Options(self.api, {}, Download(self.api, {}))
assert not options.are_global
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"
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"
def test_get_struct_method(self):
options = Options(self.api, {0: 1})
assert options.get_struct() == {0: 1}
def test_are_global_method(self):
options = Options(self.api, {})
assert options.are_global
def test_init_method(self):
assert Options(self.api, {})
def setup_method(self):
self.api = API()
self.api.set_global_options = lambda x: True
self.options = Options(self.api, {})
def test_get_method(self):
options = Options(self.api, {0: 1})
assert options.get(0) == 1
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