Add test to ensure we cannot create repos with the same name but different kinds
This commit is contained in:
parent
a2bac7dabd
commit
c3402fff5a
1 changed files with 14 additions and 0 deletions
14
data/model/test/test_repository.py
Normal file
14
data/model/test/test_repository.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
import pytest
|
||||
|
||||
from peewee import IntegrityError
|
||||
|
||||
from endpoints.test.fixtures import database_uri, init_db_path, sqlitedb_file
|
||||
from data.model.repository import create_repository
|
||||
|
||||
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')
|
Reference in a new issue