Update tests for tag removal
- Remove Tag/TagHistory model tests from unit tests - Update CacheSettings tests to remove allow_public_internet field - Replace tag= with version= in upload_test_file calls - Update test assertions to use versions instead of tags - Remove tests for tag: prefix downloads (now uses version:) - Update dependency tests for version-only schema
This commit is contained in:
@@ -192,7 +192,6 @@ class TestCacheSettingsModel:
|
||||
|
||||
settings = CacheSettings()
|
||||
assert hasattr(settings, 'id')
|
||||
assert hasattr(settings, 'allow_public_internet')
|
||||
assert hasattr(settings, 'auto_create_system_projects')
|
||||
|
||||
def test_model_with_values(self):
|
||||
@@ -201,11 +200,9 @@ class TestCacheSettingsModel:
|
||||
|
||||
settings = CacheSettings(
|
||||
id=1,
|
||||
allow_public_internet=False,
|
||||
auto_create_system_projects=True,
|
||||
)
|
||||
assert settings.id == 1
|
||||
assert settings.allow_public_internet is False
|
||||
assert settings.auto_create_system_projects is True
|
||||
|
||||
|
||||
@@ -365,16 +362,14 @@ class TestCacheSettingsSchemas:
|
||||
from app.schemas import CacheSettingsUpdate
|
||||
|
||||
update = CacheSettingsUpdate()
|
||||
assert update.allow_public_internet is None
|
||||
assert update.auto_create_system_projects is None
|
||||
|
||||
def test_update_schema_partial(self):
|
||||
"""Test CacheSettingsUpdate with partial fields."""
|
||||
from app.schemas import CacheSettingsUpdate
|
||||
|
||||
update = CacheSettingsUpdate(allow_public_internet=False)
|
||||
assert update.allow_public_internet is False
|
||||
assert update.auto_create_system_projects is None
|
||||
update = CacheSettingsUpdate(auto_create_system_projects=True)
|
||||
assert update.auto_create_system_projects is True
|
||||
|
||||
|
||||
class TestCacheRequestSchemas:
|
||||
@@ -388,7 +383,7 @@ class TestCacheRequestSchemas:
|
||||
url="https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
source_type="npm",
|
||||
package_name="lodash",
|
||||
tag="4.17.21",
|
||||
version="4.17.21",
|
||||
)
|
||||
assert request.url == "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
|
||||
assert request.source_type == "npm"
|
||||
|
||||
Reference in New Issue
Block a user