def test_vf_unknown(): """Integration tests for Vf.""" response = requests.post("{}/reset".format(Vendor.base_front_url)) response.raise_for_status() vendor = Vendor(name="test") vendor.onboard() vsp = Vsp(name="test", package=open( "{}/ubuntu16.zip".format( os.path.dirname(os.path.abspath(__file__))), 'rb')) vsp.vendor = vendor vsp.onboard() vf = Vf(name='test') vf.vsp = vsp vf.create() assert vf.identifier is not None assert vf.status == const.DRAFT assert vf.version == "0.1" vf.submit() assert vsp.status == const.CERTIFIED assert vf.version == "1.0" vf.load() assert vsp.status == const.CERTIFIED assert vf.version == "1.0"
def test_load_created(mock_exists): """Load is a wrapper around exists().""" vf = Vf(name="one") vf.load() mock_exists.assert_called_once()