Skip to content

Commit

Permalink
Merge pull request #100 from mayn/mayn-issue93
Browse files Browse the repository at this point in the history
builder/hyperv - rename HyperV builders
  • Loading branch information
mayn authored Mar 16, 2018
2 parents d597ea3 + eee3153 commit a764e5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/packerlicious/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,9 @@ class GoogleCompute(PackerBuilder):
}


class HyperV(PackerBuilder):
class HypervIso(PackerBuilder):
"""
Hyper-V Builder
Hyper-V Builder (from an ISO)
https://www.packer.io/docs/builders/hyperv-iso.html
"""
resource_type = "hyperv-iso"
Expand Down Expand Up @@ -800,7 +800,7 @@ class HyperV(PackerBuilder):
}


class HyperVvmcx(PackerBuilder):
class HypervVmcx(PackerBuilder):
"""
Hyper-V Builder (from a vmcx)
https://www.packer.io/docs/builders/hyperv-vmcx.html
Expand Down
16 changes: 8 additions & 8 deletions tests/packerlicious/test_builder_hyperv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@
import packerlicious.builder as builder


class TestHyperVBuilder(object):
class TestHypervIsoBuilder(object):

def test_required_fields_missing(self):
b = builder.HyperV()
b = builder.HypervIso()

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'required' in str(excinfo.value)


class TestHyperVvmcxBuilder(object):
class TestHypervVmcxBuilder(object):

def test_required_fields_missing(self):
b = builder.HyperVvmcx()
b = builder.HypervVmcx()

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'HyperVvmcx: one of the following must be specified: clone_from_vmxc_path, clone_from_vm_name' == str(excinfo.value)
assert 'HypervVmcx: one of the following must be specified: clone_from_vmxc_path, clone_from_vm_name' == str(excinfo.value)

def test_exactly_one_clone_from_required(self):
b = builder.HyperVvmcx(
b = builder.HypervVmcx(
clone_from_vmxc_path="c:\\virtual machines\\ubuntu-12.04.5-server-amd64",
clone_from_vm_name="ubuntu-12.04.5-server-amd64"
)

with pytest.raises(ValueError) as excinfo:
b.to_dict()
assert 'HyperVvmcx: only one of the following can be specified: clone_from_vmxc_path, clone_from_vm_name' == str(
assert 'HypervVmcx: only one of the following can be specified: clone_from_vmxc_path, clone_from_vm_name' == str(
excinfo.value)

def test_exactly_one_clone_from_specified(self):
b = builder.HyperVvmcx(
b = builder.HypervVmcx(
clone_from_vmxc_path="c:\\virtual machines\\ubuntu-12.04.5-server-amd64",
)

Expand Down

0 comments on commit a764e5a

Please sign in to comment.