repo_id
stringclasses
409 values
prefix
large_stringlengths
34
36.3k
target
large_stringlengths
1
498
assertion_type
stringclasses
31 values
difficulty
stringclasses
8 values
test_file
stringlengths
10
121
test_function
stringlengths
1
104
test_class
stringlengths
0
51
lineno
int32
2
11.3k
commit_idx
int32
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.noip import NoipProvider class TestNoipProviderIntegration(BaseProviderTestCase): def test_full_workflow_ipv6_success(self): """Test complete workflow for IPv6 record with success response""" provider = NoipP...
"::1")
self.assertEqual
string_literal
tests/test_provider_noip.py
test_full_workflow_ipv6_success
TestNoipProviderIntegration
375
null
NewFuture/DDNS
from __init__ import unittest, patch import sys import io from ddns.config.cli import load_config class TestTaskSubcommand(unittest.TestCase): def setUp(self): encode = sys.stdout.encoding if encode is not None and encode.lower() != "utf-8" and hasattr(sys.stdout, "buffer"): # 兼容window...
0)
self.assertEqual
numeric_literal
tests/test_config_cli_task.py
test_task_subcommand_help
TestTaskSubcommand
47
null
NewFuture/DDNS
import platform from __init__ import patch, unittest from ddns.scheduler.schtasks import SchtasksScheduler from ddns.util.try_run import try_run class TestSchtasksScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = SchtasksScheduler() @unittest.skipUnl...
bool)
self.assertIsInstance
variable
tests/test_scheduler_schtasks.py
test_real_schtasks_integration
TestSchtasksScheduler
178
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest, sys import json import socket import random from ddns.util.http import HttpResponse, _decode_response_body, quote, USER_AGENT def to_bytes(s, encoding="utf-8"): if isinstance(s, text_type): return s.encode(encoding) return s def t...
data)
self.assertIn
variable
tests/test_util_http.py
test_basic_get_request_with_json_response
TestSendHttpRequest
288
null
NewFuture/DDNS
from __init__ import unittest from ddns.provider._signature import hmac_sha256_authorization, sha256_hash, hmac_sha256 class TestHmacSha256Authorization(unittest.TestCase): def test_header_normalization(self): """测试头部规范化处理""" secret_key = "test_key" method = "GET" path = "/test" ...
result)
self.assertIn
variable
tests/test_provider__signature.py
test_header_normalization
TestHmacSha256Authorization
240
null
NewFuture/DDNS
from __init__ import unittest, patch import tempfile import json import os import sys from ddns.config import load_configs from ddns.config.file import load_config as load_file_config, _process_multi_providers class TestMultiConfig(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() ...
True)
self.assertEqual
bool_literal
tests/test_config_init_multi.py
test_multi_provider_proxy_individual_settings
TestMultiConfig
160
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import io import sys from ddns.config.file import load_config, save_config FileNotFoundError = globals().get("FileNotFoundError", IOError) PermissionError = globals().get("PermissionError", IOError...
1)
self.assertEqual
numeric_literal
tests/test_config_file.py
test_load_config_v41_providers_single_provider
TestConfigFile
719
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.he import HeProvider class TestHeProviderIntegration(BaseProviderTestCase): def test_full_workflow_ipv6_success(self): """Test complete workflow for IPv6 record with success response""" provider = HeProvider(...
"::1")
self.assertEqual
string_literal
tests/test_provider_he.py
test_full_workflow_ipv6_success
TestHeProviderIntegration
356
null
NewFuture/DDNS
import os import unittest from ddns.config.env import load_config class TestConfigEnv(unittest.TestCase): def setUp(self): """Set up test environment""" self._clear_env_prefix("DDNS_TEST_") self._clear_env_prefix("DDNS_") self._clear_standard_env() def tearDown(self): ...
"300")
self.assertEqual
string_literal
tests/test_config_env.py
test_mixed_params_config
TestConfigEnv
250
null
NewFuture/DDNS
import platform from __init__ import patch, unittest from ddns.scheduler.cron import CronScheduler class TestCronScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = CronScheduler() @unittest.skipIf(platform.system().lower() == "windows", "Unix/Linux/ma...
bool)
self.assertIsInstance
variable
tests/test_scheduler_cron.py
test_real_cron_integration
TestCronScheduler
198
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.dnspod import DnspodProvider class TestDnspodProviderIntegration(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestDnspodProviderIntegration, self).setUp() self.provider = DnspodProvider(s...
3)
self.assertEqual
numeric_literal
tests/test_provider_dnspod.py
test_full_workflow_create_record
TestDnspodProviderIntegration
438
null
NewFuture/DDNS
from __init__ import unittest, patch, MagicMock, call import os import tempfile import shutil import json import sys import ddns.config from ddns.config import load_configs, Config from io import StringIO, BytesIO # For capturing stdout in Python2 and Python3 def capture_stdout_output(func, *args, **kwargs): """...
"test")
self.assertEqual
string_literal
tests/test_config_init.py
test_load_config_missing_files_integration
TestConfigInit
193
null
NewFuture/DDNS
import os import shutil import tempfile from io import open # Python 2/3 compatible UTF-8 file operations from __init__ import MagicMock, patch, unittest import ddns.util.fileio as fileio TEST_ENCODING_UTF8 = "utf-8" TEST_ENCODING_ASCII = "ascii" TEST_CONTENT_MULTILINGUAL = u"Hello World! 测试内容" # fmt: skip class...
"w")
assert_*
string_literal
tests/test_util_fileio.py
test_write_file_with_mock
TestFileIOModule
214
null
NewFuture/DDNS
from base_test import unittest, BaseProviderTestCase from ddns.provider.aliesa import AliesaProvider class TestAliesaProviderIntegration(BaseProviderTestCase): def setUp(self): """Setup test provider with mock credentials""" super(TestAliesaProviderIntegration, self).setUp() self.provider ...
"111")
self.assertEqual
string_literal
tests/test_provider_aliesa.py
test_record_filtering_logic
TestAliesaProviderIntegration
475
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.huaweidns import HuaweiDNSProvider class TestHuaweiDNSProviderIntegration(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestHuaweiDNSProviderIntegration, self).setUp() self.id = "test_...
3)
self.assertEqual
numeric_literal
tests/test_provider_huaweidns.py
test_full_workflow_create_new_record
TestHuaweiDNSProviderIntegration
378
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest from ddns.provider._base import BaseProvider, encode_params class TestBaseProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestBaseProvider, self).setUp() self.provider = _TestProvider() def test_encode_none(self):...
"")
self.assertEqual
string_literal
tests/test_provider_base.py
test_encode_none
TestBaseProvider
180
null
NewFuture/DDNS
from __init__ import unittest from ddns.config.config import Config # noqa: E402 class TestConfigExtra(unittest.TestCase): def test_extra_from_cli(self): """Test extra fields from CLI config with extra_ prefix""" cli_config = { "dns": "cloudflare", "id": "test@example.com"...
"true")
self.assertEqual
string_literal
tests/test_config_extra.py
test_extra_from_cli
TestConfigExtra
26
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.he import HeProvider class TestHeProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestHeProvider, self).setUp() # Override default auth values for HE provider - HE use...
"A")
assert_*
string_literal
tests/test_provider_he.py
test_set_record_logger_info_called
TestHeProvider
283
null
NewFuture/DDNS
from __init__ import unittest, patch, MagicMock from ddns.util.http import request, quote class TestRequestProxyList(unittest.TestCase): def test_real_network_proxy_fallback(self): """测试真实网络环境下的代理失败回退(如果网络可用)""" # 尝试多个测试端点以提高可靠性,优先使用httpbin test_endpoints = ["http://httpbin.org/get", "http...
response.body)
self.assertIn
complex_expr
tests/test_util_http_proxy_list.py
test_real_network_proxy_fallback
TestRequestProxyList
143
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import io import sys from ddns.config.file import load_config, save_config FileNotFoundError = globals().get("FileNotFoundError", IOError) PermissionError = globals().get("PermissionError", IOError...
config)
self.assertNotIn
variable
tests/test_config_file.py
test_load_config_with_nested_objects_flattening
TestConfigFile
167
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import io import sys from ddns.config.file import load_config, save_config FileNotFoundError = globals().get("FileNotFoundError", IOError) PermissionError = globals().get("PermissionError", IOError...
list)
self.assertIsInstance
variable
tests/test_config_file.py
test_load_config_v41_providers_format
TestConfigFile
619
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, MagicMock from ddns.provider._base import SimpleProvider, TYPE_FORM, encode_params class _TestableSimpleProviderClass(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(_TestableSimpleProviderClass, self).setUp() def ...
0)
self.assertEqual
numeric_literal
tests/test_provider_base_simple.py
test_init_with_verify_ssl_falsy_value
_TestableSimpleProviderClass
73
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.dnscom import DnscomProvider class TestDnscomProviderIntegration(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestDnscomProviderIntegration, self).setUp() self.id = "test_api_key" ...
3)
self.assertEqual
numeric_literal
tests/test_provider_dnscom.py
test_full_workflow_create_new_record
TestDnscomProviderIntegration
346
null
NewFuture/DDNS
from __init__ import unittest from ddns.config.config import Config, split_array_string, SIMPLE_ARRAY_PARAMS # noqa: E402 class TestSplitArrayString(unittest.TestCase): def test_split_array_string_comprehensive(self): """Test split_array_string with various input types""" # List input self...
[])
self.assertEqual
collection
tests/test_config_config.py
test_split_array_string_comprehensive
TestSplitArrayString
18
null
NewFuture/DDNS
from __init__ import unittest from ddns.provider._signature import hmac_sha256_authorization, sha256_hash, hmac_sha256 class TestHmacSha256Authorization(unittest.TestCase): def test_hmac_sha256_different_key_types(self): """测试 hmac_sha256 不同密钥类型""" message = "test_message" # 字符串密钥 ...
hmac_bytes.hexdigest())
self.assertEqual
func_call
tests/test_provider__signature.py
test_hmac_sha256_different_key_types
TestHmacSha256Authorization
329
null
NewFuture/DDNS
from __init__ import unittest, patch, MagicMock, call import os import tempfile import shutil import json import sys import ddns.config from ddns.config import load_configs, Config from io import StringIO, BytesIO # For capturing stdout in Python2 and Python3 def capture_stdout_output(func, *args, **kwargs): """...
Config)
self.assertEqual
variable
tests/test_config_init.py
test_module_exports
TestConfigInit
78
null
NewFuture/DDNS
import platform from __init__ import patch, unittest from ddns.scheduler.cron import CronScheduler class TestCronScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = CronScheduler() def test_get_status_with_no_comment(self): """Test get_status h...
"")
self.assertEqual
string_literal
tests/test_scheduler_cron.py
test_get_status_with_no_comment
TestCronScheduler
136
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.namesilo import NamesiloProvider class TestNamesiloProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestNamesiloProvider, self).setUp() self.provider = NamesiloProvider(self.id, ...
"300")
self.assertEqual
string_literal
tests/test_provider_namesilo.py
test_request_success
TestNamesiloProvider
73
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.dnspod import DnspodProvider class TestDnspodProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestDnspodProvider, self).setUp() self.provider = DnspodProvider(self.id, self.token) ...
"默认")
self.assertEqual
string_literal
tests/test_provider_dnspod.py
test_init_with_basic_config
TestDnspodProvider
25
null
NewFuture/DDNS
from base_test import unittest, BaseProviderTestCase from ddns.provider.aliesa import AliesaProvider class TestAliesaProvider(BaseProviderTestCase): def setUp(self): """Setup test provider with mock credentials""" super(TestAliesaProvider, self).setUp() self.provider = AliesaProvider(id="t...
result)
self.assertTrue
variable
tests/test_provider_aliesa.py
test_create_record_logic
TestAliesaProvider
149
null
NewFuture/DDNS
import platform from __init__ import patch, unittest from ddns.scheduler.cron import CronScheduler class TestCronScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = CronScheduler() def test_get_status_handles_missing_comment_info(self): """Test...
5)
self.assertEqual
numeric_literal
tests/test_scheduler_cron.py
test_get_status_handles_missing_comment_info
TestCronScheduler
89
null
NewFuture/DDNS
from __init__ import unittest from ddns.provider._signature import hmac_sha256_authorization, sha256_hash, hmac_sha256 class TestHmacSha256Authorization(unittest.TestCase): def test_hmac_sha256_basic_functionality(self): """测试 hmac_sha256 基础功能""" key = "test_key" message = "test_message" ...
str)
self.assertIsInstance
variable
tests/test_provider__signature.py
test_hmac_sha256_basic_functionality
TestHmacSha256Authorization
309
null
NewFuture/DDNS
from base_test import unittest, BaseProviderTestCase from ddns.provider.aliesa import AliesaProvider class TestAliesaProvider(BaseProviderTestCase): def setUp(self): """Setup test provider with mock credentials""" super(TestAliesaProvider, self).setUp() self.provider = AliesaProvider(id="t...
True)
self.assertEqual
bool_literal
tests/test_provider_aliesa.py
test_update_record_extra_priority_over_old_record
TestAliesaProvider
276
null
NewFuture/DDNS
import os import unittest from ddns.config.env import load_config class TestConfigEnv(unittest.TestCase): def setUp(self): """Set up test environment""" self._clear_env_prefix("DDNS_TEST_") self._clear_env_prefix("DDNS_") self._clear_standard_env() def tearDown(self): ...
"auto")
self.assertEqual
string_literal
tests/test_config_env.py
test_ddns_variables_override_standard_vars
TestConfigEnv
109
null
NewFuture/DDNS
from __init__ import patch, unittest from ddns.scheduler._base import BaseScheduler class TestBaseScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = MockScheduler() def test_all_scheduler_interface_methods(self): """Test that scheduler implemen...
bool)
self.assertIsInstance
variable
tests/test_scheduler_base.py
test_all_scheduler_interface_methods
TestBaseScheduler
184
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest from ddns.provider.dnspod_com import DnspodComProvider class TestDnspodComProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestDnspodComProvider, self).setUp() self.id = "test_email@example.com" s...
self.token)
self.assertEqual
complex_expr
tests/test_provider_dnspod_com.py
test_init_with_basic_config
TestDnspodComProvider
30
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.noip import NoipProvider class TestNoipProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestNoipProvider, self).setUp() # No-IP uses both id (username) and token (pass...
"A")
assert_*
string_literal
tests/test_provider_noip.py
test_set_record_logger_info_called
TestNoipProvider
333
null
NewFuture/DDNS
from __init__ import unittest import sys import io from ddns.config.cli import load_config, str_bool, log_level # noqa: E402 class TestCliConfig(unittest.TestCase): def setUp(self): encode = sys.stdout.encoding if encode is not None and encode.lower() != "utf-8" and hasattr(sys.stdout, "buffer"): ...
[])
self.assertEqual
collection
tests/test_config_cli.py
test_extend_action_functionality
TestCliConfig
251
null
NewFuture/DDNS
import os import platform import subprocess from __init__ import unittest from ddns.scheduler import get_scheduler class TestSchedulerRealFunctionality(unittest.TestCase): def setUp(self): """Set up test environment""" self.current_system = platform.system().lower() self.scheduler = get_...
bool)
self.assertIsInstance
variable
tests/test_scheduler_init.py
test_windows_scheduler_real_calls
TestSchedulerRealFunctionality
168
null
NewFuture/DDNS
import platform from __init__ import patch, unittest from ddns.scheduler.cron import CronScheduler class TestCronScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = CronScheduler() @unittest.skipIf(platform.system().lower() == "windows", "Unix/Linux/ma...
dict)
self.assertIsInstance
variable
tests/test_scheduler_cron.py
test_real_cron_integration
TestCronScheduler
196
null
NewFuture/DDNS
from base_test import unittest, BaseProviderTestCase from ddns.provider.aliesa import AliesaProvider class TestAliesaProviderAPIResponse(BaseProviderTestCase): def setUp(self): """Setup test provider with mock credentials""" super(TestAliesaProviderAPIResponse, self).setUp() self.provider ...
"A")
self.assertEqual
string_literal
tests/test_provider_aliesa.py
test_different_record_types_parameters
TestAliesaProviderAPIResponse
508
null
NewFuture/DDNS
from __init__ import patch, unittest from ddns.scheduler._base import BaseScheduler class TestBaseScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = MockScheduler() def test_build_ddns_command_basic(self): """Test _build_ddns_command with basic...
list)
self.assertIsInstance
variable
tests/test_scheduler_base.py
test_build_ddns_command_basic
TestBaseScheduler
62
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.he import HeProvider class TestHeProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestHeProvider, self).setUp() # Override default auth values for HE provider - HE use...
"")
self.assertEqual
string_literal
tests/test_provider_he.py
test_init_with_basic_config
TestHeProvider
26
null
NewFuture/DDNS
from __init__ import unittest, patch, MagicMock from ddns import ip from ddns.__main__ import get_ip from ddns.util.http import HttpResponse class TestIpModule(unittest.TestCase): def setUp(self): """设置测试环境""" self.original_ssl_verify = ip.ssl_verify def tearDown(self): """清理测试环境""" ...
result)
self.assertIsNone
variable
tests/test_ip.py
test_url_v4_request_failure
TestIpModule
57
null
NewFuture/DDNS
import sys from __init__ import unittest from ddns.config.cli import load_config # noqa: E402 class TestCliExtraFields(unittest.TestCase): def setUp(self): """Save original sys.argv""" self.original_argv = sys.argv def tearDown(self): """Restore original sys.argv""" sys.argv ...
"10")
self.assertEqual
string_literal
tests/test_config_cli_extra.py
test_cli_extra_multiple_fields
TestCliExtraFields
47
null
NewFuture/DDNS
from __init__ import unittest from ddns.config.config import Config, split_array_string, SIMPLE_ARRAY_PARAMS # noqa: E402 class TestConfig(unittest.TestCase): def test_config_initialization_comprehensive(self): """Test Config initialization with various sources and priority""" # Empty initializati...
"")
self.assertEqual
string_literal
tests/test_config_config.py
test_config_initialization_comprehensive
TestConfig
51
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, patch, unittest from ddns.provider._base import SimpleProvider from ddns.util.http import HttpResponse class TestProviderProxyList(BaseProviderTestCase): def setUp(self): """设置测试环境""" super(TestProviderProxyList, self).setUp() # 创建一个包含代理列表的provid...
str(context.exception))
self.assertIn
func_call
tests/test_provider_proxy_list.py
test_provider_http_request_failure_handling
TestProviderProxyList
130
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, MagicMock from ddns.provider._base import SimpleProvider, TYPE_FORM, encode_params class _TestableSimpleProviderClass(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(_TestableSimpleProviderClass, self).setUp() def ...
1)
self.assertEqual
numeric_literal
tests/test_provider_base_simple.py
test_init_with_verify_ssl_truthy_value
_TestableSimpleProviderClass
68
null
NewFuture/DDNS
import platform from __init__ import patch, unittest from ddns.scheduler.schtasks import SchtasksScheduler from ddns.util.try_run import try_run class TestSchtasksScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = SchtasksScheduler() @unittest.skipUnl...
dict)
self.assertIsInstance
variable
tests/test_scheduler_schtasks.py
test_real_schtasks_integration
TestSchtasksScheduler
176
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.edgeone import EdgeOneProvider class TestEdgeOneProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestEdgeOneProvider, self).setUp() self.provider = EdgeOneProvider(sel...
3)
self.assertEqual
numeric_literal
tests/test_provider_edgeone.py
test_set_record_create_new
TestEdgeOneProvider
342
null
NewFuture/DDNS
import os import platform from __init__ import patch, unittest from ddns.scheduler.systemd import SystemdScheduler from ddns.util.try_run import try_run class TestSystemdScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = SystemdScheduler() @unittest.s...
bool)
self.assertIsInstance
variable
tests/test_scheduler_systemd.py
test_real_systemd_integration
TestSystemdScheduler
183
null
NewFuture/DDNS
from __init__ import unittest, patch import tempfile import json import os import sys from ddns.config import load_configs from ddns.config.file import load_config as load_file_config, _process_multi_providers class TestMultiConfig(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() ...
dict)
self.assertIsInstance
variable
tests/test_config_init_multi.py
test_file_loader_single_object
TestMultiConfig
38
null
NewFuture/DDNS
import os import platform from __init__ import patch, unittest from ddns.scheduler.systemd import SystemdScheduler from ddns.util.try_run import try_run class TestSystemdScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = SystemdScheduler() @unittest.s...
dict)
self.assertIsInstance
variable
tests/test_scheduler_systemd.py
test_real_systemd_integration
TestSystemdScheduler
187
null
NewFuture/DDNS
import os import unittest from ddns.config.env import load_config class TestConfigEnv(unittest.TestCase): def setUp(self): """Set up test environment""" self._clear_env_prefix("DDNS_TEST_") self._clear_env_prefix("DDNS_") self._clear_standard_env() def tearDown(self): ...
config)
self.assertNotIn
variable
tests/test_config_env.py
test_edge_cases
TestConfigEnv
235
null
NewFuture/DDNS
import os import sys import logging import random import platform from time import sleep from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.callback import CallbackProvider class TestCallbackProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" sup...
"")
self.assertEqual
string_literal
tests/test_provider_callback.py
test_replace_vars_empty_string
TestCallbackProvider
97
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.edgeone_dns import EdgeOneDnsProvider class TestEdgeOneDnsProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestEdgeOneDnsProvider, self).setUp() self.provider = EdgeOn...
"teo")
self.assertEqual
string_literal
tests/test_provider_edgeone_dns.py
test_init
TestEdgeOneDnsProvider
25
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.alidns import AlidnsProvider class TestAlidnsProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestAlidnsProvider, self).setUp() self.id = "test_access_key_id" self.token ...
sub)
self.assertIsNone
variable
tests/test_provider_alidns.py
test_split_zone_and_sub_not_found
TestAlidnsProvider
120
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import logging import sys from ddns.config import load_configs class TestAllConfigFormatsIntegration(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.temp_d...
2)
self.assertEqual
numeric_literal
tests/test_config_schema_v4_1.py
test_v41_providers_complex_inheritance
TestAllConfigFormatsIntegration
222
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.edgeone_dns import EdgeOneDnsProvider class TestEdgeOneDnsProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestEdgeOneDnsProvider, self).setUp() self.provider = EdgeOn...
1)
self.assertEqual
numeric_literal
tests/test_provider_edgeone_dns.py
test_update_record_success
TestEdgeOneDnsProvider
221
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.alidns import AlidnsProvider class TestAlidnsProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestAlidnsProvider, self).setUp() self.id = "test_access_key_id" self.token ...
"www")
self.assertEqual
string_literal
tests/test_provider_alidns.py
test_query_record_success_single
TestAlidnsProvider
148
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.namesilo import NamesiloProvider class TestNamesiloProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestNamesiloProvider, self).setUp() self.provider = NamesiloProvider(self.id, ...
3)
self.assertEqual
numeric_literal
tests/test_provider_namesilo.py
test_integration_set_record_update_flow
TestNamesiloProvider
306
null
NewFuture/DDNS
from __init__ import patch, unittest from ddns.scheduler._base import BaseScheduler class TestBaseScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = MockScheduler() def test_all_scheduler_interface_methods(self): """Test that scheduler implemen...
dict)
self.assertIsInstance
variable
tests/test_scheduler_base.py
test_all_scheduler_interface_methods
TestBaseScheduler
179
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import logging import sys from ddns.config import load_configs class TestAllConfigFormatsIntegration(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.temp_d...
result)
self.assertTrue
variable
tests/test_config_schema_v4_1.py
test_v41_schema_reference
TestAllConfigFormatsIntegration
151
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest, patch import tempfile import shutil import os import json import sys import socket from ddns.config.file import load_config from ddns.util.http import HttpResponse class TestRemoteConfigFile(unittest.TestCase): def setUp(self): """Set ...
url)
assert_*
variable
tests/test_config_file_remote.py
test_load_config_url_detection
TestRemoteConfigFile
291
null
NewFuture/DDNS
from __init__ import unittest import tempfile import json import os import sys import shutil from ddns.config import load_configs class TestLogFileDirectory(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() self.original_argv = sys.argv[:] def tearDown(self): sys...
2)
self.assertEqual
numeric_literal
tests/test_config_log_file_dir.py
test_log_file_with_nonexistent_directory_multi_provider
TestLogFileDirectory
100
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.dnspod import DnspodProvider class TestDnspodProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestDnspodProvider, self).setUp() self.provider = DnspodProvider(self.id, self.token) ...
"www")
self.assertEqual
string_literal
tests/test_provider_dnspod.py
test_query_record_success_single
TestDnspodProvider
133
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.namesilo import NamesiloProvider class TestNamesiloProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestNamesiloProvider, self).setUp() self.provider = NamesiloProvider(self.id, ...
"GET")
self.assertEqual
string_literal
tests/test_provider_namesilo.py
test_request_success
TestNamesiloProvider
66
null
NewFuture/DDNS
import os from __init__ import unittest from ddns.config.env import load_config # noqa: E402 class TestEnvExtraFields(unittest.TestCase): def setUp(self): """Clear DDNS environment variables before each test""" self._clear_env_prefix("DDNS_") def tearDown(self): """Clean up after tes...
"100")
self.assertEqual
string_literal
tests/test_config_env_extra.py
test_env_extra_numeric_values
TestEnvExtraFields
103
null
NewFuture/DDNS
from base_test import unittest, BaseProviderTestCase from ddns.provider.aliesa import AliesaProvider class TestAliesaProvider(BaseProviderTestCase): def setUp(self): """Setup test provider with mock credentials""" super(TestAliesaProvider, self).setUp() self.provider = AliesaProvider(id="t...
ttl)
self.assertEqual
variable
tests/test_provider_aliesa.py
test_ttl_validation
TestAliesaProvider
320
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.alidns import AlidnsProvider class TestAlidnsProviderIntegration(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestAlidnsProviderIntegration, self).setUp() self.id = "test_access_key_i...
3)
self.assertEqual
numeric_literal
tests/test_provider_alidns.py
test_full_workflow_create_new_record
TestAlidnsProviderIntegration
423
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.tencentcloud import TencentCloudProvider class TestTencentCloudProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestTencentCloudProvider, self).setUp() self.provider =...
3)
self.assertEqual
numeric_literal
tests/test_provider_tencentcloud.py
test_set_record_create_new
TestTencentCloudProvider
335
null
NewFuture/DDNS
import os import unittest from ddns.config.env import load_config class TestConfigEnv(unittest.TestCase): def setUp(self): """Set up test environment""" self._clear_env_prefix("DDNS_TEST_") self._clear_env_prefix("DDNS_") self._clear_standard_env() def tearDown(self): ...
"")
self.assertEqual
string_literal
tests/test_config_env.py
test_empty_values_remain_as_strings
TestConfigEnv
200
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.dnspod import DnspodProvider class TestDnspodProviderIntegration(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestDnspodProviderIntegration, self).setUp() self.provider = DnspodProvider(s...
"电信")
self.assertEqual
string_literal
tests/test_provider_dnspod.py
test_full_workflow_with_options
TestDnspodProviderIntegration
533
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import io import sys from ddns.config.file import load_config, save_config FileNotFoundError = globals().get("FileNotFoundError", IOError) PermissionError = globals().get("PermissionError", IOError...
"1.0")
self.assertEqual
string_literal
tests/test_config_file.py
test_load_config_mixed_types_comprehensive
TestConfigFile
586
null
NewFuture/DDNS
import os import sys import logging import random import platform from time import sleep from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.callback import CallbackProvider class TestCallbackProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" sup...
token)
self.assertEqual
variable
tests/test_provider_callback.py
test_init_with_token_config
TestCallbackProvider
38
null
NewFuture/DDNS
import os import platform import subprocess from __init__ import unittest from ddns.scheduler import get_scheduler class TestSchedulerRealFunctionality(unittest.TestCase): def setUp(self): """Set up test environment""" self.current_system = platform.system().lower() self.scheduler = get_...
str)
self.assertIsInstance
variable
tests/test_scheduler_init.py
test_scheduler_status_call
TestSchedulerRealFunctionality
119
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.dnspod import DnspodProvider class TestDnspodProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestDnspodProvider, self).setUp() self.provider = DnspodProvider(self.id, self.token) ...
5)
self.assertEqual
numeric_literal
tests/test_provider_dnspod.py
test_update_record_extra_priority_over_old_record
TestDnspodProvider
339
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.dnscom import DnscomProvider class TestDnscomProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestDnscomProvider, self).setUp() self.id = "test_api_key" self.token = "tes...
"123")
self.assertEqual
string_literal
tests/test_provider_dnscom.py
test_query_record_success
TestDnscomProvider
155
null
NewFuture/DDNS
import os import platform from __init__ import patch, unittest from ddns.scheduler.systemd import SystemdScheduler from ddns.util.try_run import try_run class TestSystemdScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = SystemdScheduler() def test_bu...
list)
self.assertIsInstance
variable
tests/test_scheduler_systemd.py
test_build_ddns_command
TestSystemdScheduler
122
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.dnspod import DnspodProvider class TestDnspodProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestDnspodProvider, self).setUp() self.provider = DnspodProvider(self.id, self.token) ...
"123")
self.assertEqual
string_literal
tests/test_provider_dnspod.py
test_query_record_success_single
TestDnspodProvider
132
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.edgeone import EdgeOneProvider class TestEdgeOneProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestEdgeOneProvider, self).setUp() self.provider = EdgeOneProvider(sel...
"teo")
self.assertEqual
string_literal
tests/test_provider_edgeone.py
test_init
TestEdgeOneProvider
25
null
NewFuture/DDNS
from __init__ import unittest, patch import sys import io from ddns.config.cli import load_config class TestTaskSubcommand(unittest.TestCase): def setUp(self): encode = sys.stdout.encoding if encode is not None and encode.lower() != "utf-8" and hasattr(sys.stdout, "buffer"): # 兼容window...
5)
self.assertEqual
numeric_literal
tests/test_config_cli_task.py
test_task_subcommand_force_install
TestTaskSubcommand
218
null
NewFuture/DDNS
from __init__ import unittest, patch, MagicMock, call import os import tempfile import shutil import json import sys import ddns.config from ddns.config import load_configs, Config from io import StringIO, BytesIO # For capturing stdout in Python2 and Python3 def capture_stdout_output(func, *args, **kwargs): """...
int)
self.assertIsInstance
variable
tests/test_config_init.py
test_special_value_handling_integration
TestConfigInit
445
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest from ddns.provider._base import BaseProvider, encode_params class TestBaseProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestBaseProvider, self).setUp() self.provider = _TestProvider() def test_split_custom_domai...
sub)
self.assertIsNone
variable
tests/test_provider_base.py
test_split_custom_domain_no_separator
TestBaseProvider
149
null
NewFuture/DDNS
import os import platform import sys from __init__ import patch, unittest from ddns.scheduler.launchd import LaunchdScheduler from ddns.util.try_run import try_run class TestLaunchdScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = LaunchdScheduler() ...
list)
self.assertIsInstance
variable
tests/test_scheduler_launchd.py
test_build_ddns_command
TestLaunchdScheduler
180
null
NewFuture/DDNS
from __future__ import unicode_literals import socket import ssl from __init__ import unittest, patch, MagicMock import logging from ddns.util.http import RetryHandler, request class TestHttpRetryRealNetwork(unittest.TestCase): def test_ssl_certificate_error_no_retry_real_case(self): """测试SSL证书错误不触发重试 - ...
str(e))
self.assertIn
func_call
tests/test_util_http_retry.py
test_ssl_certificate_error_no_retry_real_case
TestHttpRetryRealNetwork
428
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.tencentcloud import TencentCloudProvider class TestTencentCloudProviderRealRequest(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestTencentCloudProviderRealRequest, self).setUp() ...
1)
self.assertGreaterEqual
numeric_literal
tests/test_provider_tencentcloud.py
test_auth_failure_real_request
TestTencentCloudProviderRealRequest
550
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import io import sys from ddns.config.file import load_config, save_config FileNotFoundError = globals().get("FileNotFoundError", IOError) PermissionError = globals().get("PermissionError", IOError...
2)
self.assertEqual
numeric_literal
tests/test_config_file.py
test_load_config_v41_providers_format
TestConfigFile
620
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest from ddns.provider._base import BaseProvider, encode_params class TestBaseProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestBaseProvider, self).setUp() self.provider = _TestProvider() def test_init_success(self)...
None)
self.assertEqual
none_literal
tests/test_provider_base.py
test_init_success
TestBaseProvider
53
null
NewFuture/DDNS
from __init__ import unittest import tempfile import json import os import sys import shutil from ddns.config import load_configs class TestLogFileDirectory(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() self.original_argv = sys.argv[:] def tearDown(self): sys...
os.path.exists(log_dir))
self.assertFalse
func_call
tests/test_config_log_file_dir.py
test_log_file_with_nonexistent_directory_single_config
TestLogFileDirectory
42
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest import tempfile import shutil import os import json import io import sys from ddns.config.file import load_config, save_config FileNotFoundError = globals().get("FileNotFoundError", IOError) PermissionError = globals().get("PermissionError", IOError...
"🌍🔧⚡")
self.assertEqual
string_literal
tests/test_config_file.py
test_load_config_file_encoding_utf8
TestConfigFile
473
null
NewFuture/DDNS
from __init__ import patch, unittest import os import tempfile from time import sleep from ddns.cache import Cache # noqa: E402 class TestCache(unittest.TestCase): def setUp(self): """Set up test fixtures""" # Create a temporary directory for test cache files self.cache_file = tempfile.m...
1)
self.assertEqual
numeric_literal
tests/test_cache.py
test_delitem
TestCache
91
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch, MagicMock from ddns.provider.he import HeProvider class TestHeProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestHeProvider, self).setUp() # Override default auth values for HE provider - HE use...
2)
self.assertEqual
numeric_literal
tests/test_provider_he.py
test_set_record_logger_info_on_success
TestHeProvider
299
null
NewFuture/DDNS
from __future__ import unicode_literals from __init__ import unittest, patch import tempfile import shutil import os import json import sys import socket from ddns.config.file import load_config from ddns.util.http import HttpResponse class TestRemoteConfigFile(unittest.TestCase): def setUp(self): """Set ...
"🌍🔧⚡")
self.assertEqual
string_literal
tests/test_config_file_remote.py
test_load_config_remote_unicode_content
TestRemoteConfigFile
249
null
NewFuture/DDNS
from __init__ import unittest import tempfile import json import os import sys import shutil from ddns.config import load_configs class TestLogFileDirectory(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() self.original_argv = sys.argv[:] def tearDown(self): sys...
1)
self.assertEqual
numeric_literal
tests/test_config_log_file_dir.py
test_log_file_with_nonexistent_directory_single_config
TestLogFileDirectory
63
null
NewFuture/DDNS
import platform from __init__ import patch, unittest from ddns.scheduler.cron import CronScheduler class TestCronScheduler(unittest.TestCase): def setUp(self): """Set up test fixtures""" self.scheduler = CronScheduler() def _setup_real_cron_test(self): """ Helper method to s...
list)
self.assertIsInstance
variable
tests/test_scheduler_cron.py
test_real_scheduler_methods_safe
TestCronScheduler
236
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest, patch from ddns.provider.alidns import AlidnsProvider class TestAlidnsProvider(BaseProviderTestCase): def setUp(self): """Set up test fixtures""" super(TestAlidnsProvider, self).setUp() self.id = "test_access_key_id" self.token ...
result)
self.assertIsNotNone
variable
tests/test_provider_alidns.py
test_query_record_success_single
TestAlidnsProvider
145
null
NewFuture/DDNS
from base_test import BaseProviderTestCase, unittest from ddns.provider._base import BaseProvider, encode_params class TestBaseProvider(BaseProviderTestCase): def setUp(self): """测试初始化""" super(TestBaseProvider, self).setUp() self.provider = _TestProvider() def test_remark_exists_and_...
str)
self.assertIsInstance
variable
tests/test_provider_base.py
test_remark_exists_and_format
TestBaseProvider
95
null
NewFuture/DDNS
from __init__ import unittest, patch, MagicMock, call import os import tempfile import shutil import json import sys import ddns.config from ddns.config import load_configs, Config from io import StringIO, BytesIO # For capturing stdout in Python2 and Python3 def capture_stdout_output(func, *args, **kwargs): """...
2)
self.assertEqual
numeric_literal
tests/test_config_init.py
test_load_config_config_object_creation
TestConfigInit
241
null
NewFuture/DDNS
import os import platform import subprocess from __init__ import unittest from ddns.scheduler import get_scheduler class TestSchedulerRealFunctionality(unittest.TestCase): def setUp(self): """Set up test environment""" self.current_system = platform.system().lower() self.scheduler = get_...
0)
self.assertGreater
numeric_literal
tests/test_scheduler_init.py
test_scheduler_safe_operations
TestSchedulerRealFunctionality
260
null