def test_ConfigRequest_removeMo_no_configMos_left(self): fvTenant = Tenant('uni', 'testing') fvnsVlanInstP = VlanInstP('uni/infra', 'namespace1', 'dynamic') cr = ConfigRequest() cr.addMo(fvTenant) cr.removeMo(fvTenant) assert not cr.hasMo(fvTenant.dn)
def test_ConfigRequest_removeMo_and_hasMo_positive(self): fvTenant = Tenant('uni', 'testing') fvnsVlanInstP = VlanInstP('uni/infra', 'namespace1', 'dynamic') cr = ConfigRequest() cr.addMo(fvTenant) cr.removeMo(fvTenant) cr.addMo(fvnsVlanInstP) assert cr.hasMo(fvnsVlanInstP.dn)
def test_ConfigRequest_removeMo_raises(self): fvTenant = Tenant('uni', 'testing') cr = ConfigRequest() with pytest.raises(KeyError): cr.removeMo(fvTenant)