def test_load_json_file(self): file_data = '{"key": "value"}' with self.get_file_open_patch(file_data): a = BasicFuncs.load_json_file('does-not-matter') valid_output = {'key': 'value'} self.assertEqual(a, valid_output)
def load_cookies(self, cookies_json_path: str): json_cookies = BasicFuncs.load_json_file(cookies_json_path) for cookie_name, cookie_value in json_cookies.items(): self.add_cookie({'name': cookie_name, 'value': cookie_value}) return json_cookies