add vms fixture that gets recorded using vcrpy
Should help prevent creating duplicate vcrpy yaml's in onedns/tests/fixtures for the same 'get all vms' request in multiple tests.master
parent
6892508b9e
commit
56f6998753
|
@ -1,6 +1,7 @@
|
|||
import pytest
|
||||
|
||||
from onedns import resolver
|
||||
from onedns.tests import vcr
|
||||
from onedns.clients import one
|
||||
|
||||
|
||||
|
@ -23,3 +24,9 @@ def oneclient(request):
|
|||
NOTE: All fixtures must be function scope to work with VCRPY cassettes
|
||||
"""
|
||||
return one.OneClient()
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@vcr.use_cassette()
|
||||
def vms(oneclient):
|
||||
return oneclient.vms()
|
||||
|
|
|
@ -6,9 +6,7 @@ import oca
|
|||
from oca import vm
|
||||
|
||||
|
||||
@vcr.use_cassette()
|
||||
def test_get_vms(oneclient):
|
||||
vms = oneclient.vms()
|
||||
def test_get_vms(vms):
|
||||
assert isinstance(vms, vm.VirtualMachinePool)
|
||||
assert len(vms) > 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue