Create the project on compute only when needed

This commit is contained in:
Julien Duponchelle committed 2016-05-11 10:56:43 +02:00
1 parent ed0bae8689
commit cd836f146e
2 files changed
+19 -6

No files matched your search

+13 -5
View File
@@ -69,6 +69,13 @@ def test_captures_directory(tmpdir):
assert os.path.exists(p.captures_directory)
def test_addCompute(async_run):
compute = MagicMock()
project = Project()
async_run(project.addCompute(compute))
assert compute in project._computes
def test_addVM(async_run):
compute = MagicMock()
project = Project()
@@ -79,11 +86,12 @@ def test_addVM(async_run):
vm = async_run(project.addVM(compute, None, name="test", vm_type="vpcs", properties={"startup_config": "test.cfg"}))
compute.post.assert_called_with('/projects/{}/vpcs/vms'.format(project.id),
data={'vm_id': vm.id,
'console_type': 'telnet',
'startup_config': 'test.cfg',
'name': 'test'})
compute.post.assert_any_call('/projects/{}/vpcs/vms'.format(project.id),
data={'vm_id': vm.id,
'console_type': 'telnet',
'startup_config': 'test.cfg',
'name': 'test'})
assert compute in project._project_created_on_compute
def test_getVM(async_run):