feat: use system curl for cmhub image downloads
This commit is contained in:
@@ -101,6 +101,39 @@ class AppConfigTests(TempDirMixin, unittest.TestCase):
|
||||
|
||||
self.assert_removed(temp_dir)
|
||||
|
||||
def test_cmhub_download_with_curl_mode_is_normalized(self):
|
||||
with self.make_temp_dir() as temp_dir:
|
||||
config_path = os.path.join(temp_dir, "config.json")
|
||||
|
||||
config = appconfig.load_config(config_path)
|
||||
self.assertEqual("auto", appconfig.cmhub_config(config)["download_with_curl"])
|
||||
|
||||
saved = appconfig.save_config(
|
||||
{
|
||||
"ai": {
|
||||
"cmhub": {
|
||||
"download_with_curl": True,
|
||||
}
|
||||
}
|
||||
},
|
||||
path=config_path,
|
||||
)
|
||||
self.assertEqual("true", appconfig.cmhub_config(saved)["download_with_curl"])
|
||||
|
||||
saved = appconfig.save_config(
|
||||
{
|
||||
"ai": {
|
||||
"cmhub": {
|
||||
"download_with_curl": "invalid",
|
||||
}
|
||||
}
|
||||
},
|
||||
path=config_path,
|
||||
)
|
||||
self.assertEqual("auto", appconfig.cmhub_config(saved)["download_with_curl"])
|
||||
|
||||
self.assert_removed(temp_dir)
|
||||
|
||||
def test_data_paths_resolve_under_default_data_dir(self):
|
||||
with self.make_temp_dir() as temp_dir:
|
||||
data_root = os.path.join(temp_dir, "data")
|
||||
|
||||
Reference in New Issue
Block a user