def test_validation_allows_any_uploaded_name_without_slash(self): name = factory.make_name('name') arch = '%s/%s' % ( factory.make_name('arch'), factory.make_name('subarch')) resource = BootResource( rtype=BOOT_RESOURCE_TYPE.UPLOADED, name=name, architecture=arch) resource.save()
def test_validation_allows_any_uploaded_name_slash_with_supported_os(self): osystem = factory.make_name('osystem') make_osystem(self, osystem) name = '%s/%s' % (osystem, factory.make_name('release')) arch = '%s/%s' % ( factory.make_name('arch'), factory.make_name('subarch')) resource = BootResource( rtype=BOOT_RESOURCE_TYPE.UPLOADED, name=name, architecture=arch) resource.save()
def test_validation_allows_any_uploaded_name_slash_with_supported_os(self): osystem = factory.make_name("osystem") make_osystem(self, osystem) name = "%s/%s" % (osystem, factory.make_name("release")) arch = "%s/%s" % ( factory.make_name("arch"), factory.make_name("subarch"), ) resource = BootResource( rtype=BOOT_RESOURCE_TYPE.UPLOADED, name=name, architecture=arch ) resource.save()
def test_validation_allows_any_uploaded_name_slash_with_supported_os(self): osystem = factory.make_name('osystem') self.patch(osystems, 'gen_all_known_operating_systems').return_value = [{ 'name': osystem }] name = '%s/%s' % (osystem, factory.make_name('release')) arch = '%s/%s' % (factory.make_name('arch'), factory.make_name('subarch')) resource = BootResource(rtype=BOOT_RESOURCE_TYPE.UPLOADED, name=name, architecture=arch) resource.save()