Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,10 @@ def _get_test_cmd():


class TestVMImage(unittest.TestCase):
@mock.patch('azure.cli.command_modules.vm.custom.urlopen', autospec=True)
def test_read_images_from_alias_doc(self, mock_urlopen):

def test_read_images_from_alias_doc(self):
from azure.cli.command_modules.vm.custom import list_vm_images
cmd = _get_test_cmd()
file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'aliases.json')
with open(file_path, 'r') as test_file:
test_data = test_file.read().encode()

mock_read = mock.MagicMock()
mock_read.read.return_value = test_data
mock_urlopen.return_value = mock_read

# action
images = list_vm_images(cmd)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,10 @@ def _get_test_cmd():


class TestVMImage(unittest.TestCase):
@mock.patch('azure.cli.command_modules.vm.custom.urlopen', autospec=True)
def test_read_images_from_alias_doc(self, mock_urlopen):

def test_read_images_from_alias_doc(self):
from azure.cli.command_modules.vm.custom import list_vm_images
cmd = _get_test_cmd()
file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'aliases.json')
with open(file_path, 'r') as test_file:
test_data = test_file.read().encode()

mock_read = mock.MagicMock()
mock_read.read.return_value = test_data
mock_urlopen.return_value = mock_read

# action
images = list_vm_images(cmd)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,10 @@ def _get_test_cmd():


class TestVMImage(unittest.TestCase):
@mock.patch('azure.cli.command_modules.vm.custom.urlopen', autospec=True)
def test_read_images_from_alias_doc(self, mock_urlopen):

def test_read_images_from_alias_doc(self):
from azure.cli.command_modules.vm.custom import list_vm_images
cmd = _get_test_cmd()
file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'aliases.json')
with open(file_path, 'r') as test_file:
test_data = test_file.read().encode()

mock_read = mock.MagicMock()
mock_read.read.return_value = test_data
mock_urlopen.return_value = mock_read

# action
images = list_vm_images(cmd)
Expand Down
Loading