1
# Copyright 2011 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Tests for SourcePackageName"""
8
from testtools.testcase import ExpectedException
10
from canonical.testing.layers import DatabaseLayer
11
from lp.registry.errors import InvalidName
12
from lp.registry.model.sourcepackagename import SourcePackageNameSet
13
from lp.testing import TestCase
16
class TestSourcePackageNameSet(TestCase):
20
def test_invalid_name(self):
21
with ExpectedException(
23
'invalid%20name is not a valid name for a source package.'):
24
SourcePackageNameSet().new('invalid%20name')