Rename invalid domain name to be RFC compliant.
http://tools.ietf.org/html/rfc6761 and http://tools.ietf.org/html/rfc2606 define invalid domain names to be used in contexts such as this. It's good to be compliant with RFCs. Change-Id: Ibb7f9ee12c0c4331f8a33470def74c3a136ef6d9
This commit is contained in:
@@ -27,7 +27,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
def test_print_image_formatted(self):
|
def test_print_image_formatted(self):
|
||||||
|
|
||||||
class FakeClient():
|
class FakeClient():
|
||||||
endpoint = 'http://no.where'
|
endpoint = 'http://is.invalid'
|
||||||
|
|
||||||
class FakeImage():
|
class FakeImage():
|
||||||
id = 1
|
id = 1
|
||||||
@@ -62,7 +62,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
updated_at = '04.03.2013'
|
updated_at = '04.03.2013'
|
||||||
deleted_at = '04.03.2013'
|
deleted_at = '04.03.2013'
|
||||||
|
|
||||||
gc = client.Client('1', 'http://no.where:8080')
|
gc = client.Client('1', 'http://is.invalid:8080')
|
||||||
test_shell.print_image_formatted(gc, FakeImage())
|
test_shell.print_image_formatted(gc, FakeImage())
|
||||||
|
|
||||||
def test_get_image_fields_from_args(self):
|
def test_get_image_fields_from_args(self):
|
||||||
@@ -87,7 +87,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
|
|
||||||
def test_do_add_error(self):
|
def test_do_add_error(self):
|
||||||
class FakeClient():
|
class FakeClient():
|
||||||
endpoint = 'http://no.where'
|
endpoint = 'http://is.invalid'
|
||||||
|
|
||||||
class args:
|
class args:
|
||||||
fields = 'name'
|
fields = 'name'
|
||||||
@@ -96,7 +96,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
self.assertEqual(1, actual)
|
self.assertEqual(1, actual)
|
||||||
|
|
||||||
def test_do_add(self):
|
def test_do_add(self):
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
|
|
||||||
class FakeImage():
|
class FakeImage():
|
||||||
fields = ['name=test',
|
fields = ['name=test',
|
||||||
@@ -114,7 +114,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
self.assertEqual(0, actual)
|
self.assertEqual(0, actual)
|
||||||
|
|
||||||
def test_do_add_with_image_meta(self):
|
def test_do_add_with_image_meta(self):
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
|
|
||||||
class FakeImage():
|
class FakeImage():
|
||||||
fields = ['name=test',
|
fields = ['name=test',
|
||||||
@@ -136,7 +136,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
self.assertEqual(0, actual)
|
self.assertEqual(0, actual)
|
||||||
|
|
||||||
def test_do_add_without_dry_run(self):
|
def test_do_add_without_dry_run(self):
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
|
|
||||||
class FakeImage():
|
class FakeImage():
|
||||||
fields = ['name=test',
|
fields = ['name=test',
|
||||||
@@ -237,7 +237,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
|
|
||||||
def test_do_update_error(self):
|
def test_do_update_error(self):
|
||||||
class FakeClient():
|
class FakeClient():
|
||||||
endpoint = 'http://no.where'
|
endpoint = 'http://is.invalid'
|
||||||
|
|
||||||
class Image():
|
class Image():
|
||||||
fields = ['id', 'is_public', 'name']
|
fields = ['id', 'is_public', 'name']
|
||||||
@@ -254,7 +254,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
id = 'test'
|
id = 'test'
|
||||||
|
|
||||||
args = Image()
|
args = Image()
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
exc.InvalidEndpoint, test_shell.do_update, gc, args)
|
exc.InvalidEndpoint, test_shell.do_update, gc, args)
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
id = 'test'
|
id = 'test'
|
||||||
|
|
||||||
args = Image()
|
args = Image()
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
actual = test_shell.do_update(gc, args)
|
actual = test_shell.do_update(gc, args)
|
||||||
self.assertEqual(0, actual)
|
self.assertEqual(0, actual)
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
created_at = '12.09.2013'
|
created_at = '12.09.2013'
|
||||||
|
|
||||||
args = Image()
|
args = Image()
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(gc.images, 'update') as mocked_update:
|
with mock.patch.object(gc.images, 'update') as mocked_update:
|
||||||
mocked_update.return_value = Image()
|
mocked_update.return_value = Image()
|
||||||
actual = test_shell.do_update(gc, args)
|
actual = test_shell.do_update(gc, args)
|
||||||
@@ -351,7 +351,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
owner = 'test'
|
owner = 'test'
|
||||||
updated_at = '04.03.2013'
|
updated_at = '04.03.2013'
|
||||||
|
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(gc.images, 'get') as mocked_get:
|
with mock.patch.object(gc.images, 'get') as mocked_get:
|
||||||
mocked_get.return_value = Image()
|
mocked_get.return_value = Image()
|
||||||
actual = test_shell.do_show(gc, Image())
|
actual = test_shell.do_show(gc, Image())
|
||||||
@@ -372,7 +372,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
size = 1024
|
size = 1024
|
||||||
|
|
||||||
args = Image()
|
args = Image()
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(gc.images, 'list') as mocked_list:
|
with mock.patch.object(gc.images, 'list') as mocked_list:
|
||||||
mocked_list.return_value = [Image(), Image()]
|
mocked_list.return_value = [Image(), Image()]
|
||||||
actual = test_shell.do_index(gc, args)
|
actual = test_shell.do_index(gc, args)
|
||||||
@@ -392,7 +392,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
size = 1024
|
size = 1024
|
||||||
|
|
||||||
args = Image()
|
args = Image()
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(test_shell, '_get_images') as mocked_get:
|
with mock.patch.object(test_shell, '_get_images') as mocked_get:
|
||||||
mocked_get.return_value = False
|
mocked_get.return_value = False
|
||||||
actual = test_shell.do_index(gc, args)
|
actual = test_shell.do_index(gc, args)
|
||||||
@@ -420,7 +420,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
created_at = '12.12.12'
|
created_at = '12.12.12'
|
||||||
|
|
||||||
args = Image()
|
args = Image()
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(gc.images, 'list') as mocked_list:
|
with mock.patch.object(gc.images, 'list') as mocked_list:
|
||||||
mocked_list.return_value = [Image(), Image()]
|
mocked_list.return_value = [Image(), Image()]
|
||||||
actual = test_shell.do_details(gc, args)
|
actual = test_shell.do_details(gc, args)
|
||||||
@@ -498,7 +498,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.member_id = 'test'
|
self.member_id = 'test'
|
||||||
|
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(gc.image_members, 'list') as mocked_list:
|
with mock.patch.object(gc.image_members, 'list') as mocked_list:
|
||||||
mocked_list.return_value = []
|
mocked_list.return_value = []
|
||||||
actual = test_shell.do_member_images(gc, FakeImage1())
|
actual = test_shell.do_member_images(gc, FakeImage1())
|
||||||
@@ -529,7 +529,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
self.image_id = 'fake_id'
|
self.image_id = 'fake_id'
|
||||||
self.member_id = 'test'
|
self.member_id = 'test'
|
||||||
|
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
actual = test_shell.do_members_replace(gc, Fake())
|
actual = test_shell.do_members_replace(gc, Fake())
|
||||||
|
|
||||||
def test_do_members_replace_dry_run_false(self):
|
def test_do_members_replace_dry_run_false(self):
|
||||||
@@ -540,7 +540,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
self.image_id = 'fake_id'
|
self.image_id = 'fake_id'
|
||||||
self.member_id = 'test'
|
self.member_id = 'test'
|
||||||
|
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
|
|
||||||
with mock.patch.object(gc.image_members, 'list') as mocked_list:
|
with mock.patch.object(gc.image_members, 'list') as mocked_list:
|
||||||
mocked_list.return_value = []
|
mocked_list.return_value = []
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ class ShellInvalidEndpointTest(utils.TestCase):
|
|||||||
'OS_AUTH_TOKEN': 'pass',
|
'OS_AUTH_TOKEN': 'pass',
|
||||||
'OS_IMAGE_API_VERSION': '1',
|
'OS_IMAGE_API_VERSION': '1',
|
||||||
'OS_REGION_NAME': 'test',
|
'OS_REGION_NAME': 'test',
|
||||||
'OS_IMAGE_URL': 'http://no.where'}
|
'OS_IMAGE_URL': 'http://is.invalid'}
|
||||||
|
|
||||||
self.shell = shell.OpenStackImagesShell()
|
self.shell = shell.OpenStackImagesShell()
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ from glanceclient.v2 import shell as test_shell
|
|||||||
|
|
||||||
class LegacyShellV1Test(testtools.TestCase):
|
class LegacyShellV1Test(testtools.TestCase):
|
||||||
def test_do_image_list(self):
|
def test_do_image_list(self):
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
|
|
||||||
class Fake():
|
class Fake():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -39,7 +39,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
actual = test_shell.do_image_list(gc, Fake())
|
actual = test_shell.do_image_list(gc, Fake())
|
||||||
|
|
||||||
def test_do_image_show(self):
|
def test_do_image_show(self):
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
|
|
||||||
class Fake():
|
class Fake():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -70,7 +70,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
id = 'pass'
|
id = 'pass'
|
||||||
file = 'test'
|
file = 'test'
|
||||||
|
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(gc.images, 'data') as mocked_data:
|
with mock.patch.object(gc.images, 'data') as mocked_data:
|
||||||
mocked_data.return_value = 'test_passed'
|
mocked_data.return_value = 'test_passed'
|
||||||
test_shell.do_image_download(gc, Fake())
|
test_shell.do_image_download(gc, Fake())
|
||||||
@@ -80,7 +80,7 @@ class LegacyShellV1Test(testtools.TestCase):
|
|||||||
id = 'pass'
|
id = 'pass'
|
||||||
file = 'test'
|
file = 'test'
|
||||||
|
|
||||||
gc = client.Client('1', 'http://no.where')
|
gc = client.Client('1', 'http://is.invalid')
|
||||||
with mock.patch.object(gc.images, 'delete') as mocked_delete:
|
with mock.patch.object(gc.images, 'delete') as mocked_delete:
|
||||||
mocked_delete.return_value = 0
|
mocked_delete.return_value = 0
|
||||||
test_shell.do_image_delete(gc, Fake())
|
test_shell.do_image_delete(gc, Fake())
|
||||||
|
|||||||
Reference in New Issue
Block a user