| 1 |
from kiwi.storage.subformat.template.vagrant_config import ( |
| 2 |
VagrantConfigTemplate |
| 3 |
) |
| 4 |
|
| 5 |
from textwrap import dedent |
| 6 |
|
| 7 |
|
| 8 |
class TestVagrantConfigTemplate: |
| 9 |
def setup(self): |
| 10 |
self.vagrant_config = VagrantConfigTemplate() |
| 11 |
|
| 12 |
def setup_method(self, cls): |
| 13 |
self.setup() |
| 14 |
|
| 15 |
def test_default_Vagrantfile(self): |
| 16 |
Vagrantfile = dedent(''' |
| 17 |
Vagrant.configure("2") do |config| |
| 18 |
end |
| 19 |
''').strip() |
| 20 |
assert self.vagrant_config.get_template() == Vagrantfile |
| 21 |
|
| 22 |
def test_customized_Vagrantfile(self): |
| 23 |
Vagrantfile = dedent(''' |
| 24 |
Vagrant.configure("2") do |config| |
| 25 |
config.vm.hostname = "no-dead-beef" |
| 26 |
config.vm.provider :special do |special| |
| 27 |
special.secret_settings = "please_work" |
| 28 |
end |
| 29 |
end |
| 30 |
''').strip() |
| 31 |
extra_settings = dedent(''' |
| 32 |
config.vm.hostname = "no-dead-beef" |
| 33 |
config.vm.provider :special do |special| |
| 34 |
special.secret_settings = "please_work" |
| 35 |
end |
| 36 |
''').strip() |
| 37 |
assert self.vagrant_config.get_template(extra_settings) == Vagrantfile |