a949a44cb2
We don't need to list all the tags to determine if any exist, and showing the repo is ready when it is empty is probably correct behavior anyway
21 lines
707 B
Python
21 lines
707 B
Python
import pytest
|
|
|
|
from peewee import IntegrityError
|
|
|
|
from data.model.repository import create_repository, purge_repository, is_empty
|
|
from test.fixtures import *
|
|
|
|
def test_duplicate_repository_different_kinds(initialized_db):
|
|
# Create an image repo.
|
|
create_repository('devtable', 'somenewrepo', None, repo_kind='image')
|
|
|
|
# Try to create an app repo with the same name, which should fail.
|
|
with pytest.raises(IntegrityError):
|
|
create_repository('devtable', 'somenewrepo', None, repo_kind='application')
|
|
|
|
|
|
def test_is_empty(initialized_db):
|
|
create_repository('devtable', 'somenewrepo', None, repo_kind='image')
|
|
|
|
assert is_empty('devtable', 'somenewrepo')
|
|
assert not is_empty('devtable', 'simple')
|