c5bb9abf11
Make sure we don't invoke the APIs to non-existent endpoints
14 lines
536 B
Python
14 lines
536 B
Python
import pytest
|
|
|
|
from peewee import IntegrityError
|
|
|
|
from data.model.repository import create_repository, purge_repository
|
|
from test.fixtures import database_uri, init_db_path, sqlitedb_file
|
|
|
|
def test_duplicate_repository_different_kinds(database_uri):
|
|
# 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')
|