-- Iir to ortho translator. -- Copyright (C) 2002 - 2014 Tristan Gingold -- -- GHDL is free software; you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free -- Software Foundation; either version 2, or (at your option) any later -- version. -- -- GHDL is distributed in the hope that it will be useful, but WITHOUT ANY -- WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- -- You should have received a copy of the GNU General Public License -- along with GCC; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. with Vhdl.Errors; use Vhdl.Errors; with Vhdl.Utils; use Vhdl.Utils; with Translation; use Translation; with Trans.Chap2; with Trans.Chap3; with Trans.Chap4; with Trans.Chap5; with Trans.Chap6; with Trans.Chap7; with Trans.Chap9; with Trans.Rtis; with Trans.Helpers2; use Trans.Helpers2; with Name_Table; package body Trans.Chap1 is use Trans.Helpers; procedure Start_Block_Decl (Blk : Iir) is Info : constant Block_Info_Acc := Get_Info (Blk); begin Chap2.Declare_Inst_Type_And_Ptr (Info.Block_Scope'Access, Info.Block_Decls_Ptr_Type); end Start_Block_Decl; procedure Translate_Entity_Init_Generics (Entity : Iir) is El : Iir; begin Push_Local_Factory; El := Get_Generic_Chain (Entity); while El /= Null_Iir loop Open_Temp; declare Val : constant Iir := Get_Default_Value (El); El_Type : constant Iir := Get_Type (El); begin if Val = Null_Iir and then Get_Kind (El_Type) in Iir_Kinds_Array_Type_Definition and then Get_Constraint_State (El_Type) /= Fully_Constrained then -- Do not initialize unconstrained array. They will have -- to be overriden by user. null; else Chap4.Elab_Object_Value (El, Val); end if; end; Close_Temp; El := Get_Chain (El); end loop; Pop_Local_Factory; end Translate_Entity_Init_Generics; procedure Translate_Entity_Init_Ports (Entity : Iir) is El : Iir; El_Type : Iir; Default : Iir; Value : Iir; begin Push_Local_Factory; Default := Null_Iir; El := Get_Port_Chain (Entity); while El /= Null_Iir loop Open_Temp; El_Type := Get_Type (El); if not Is_Fully_Constrained_Type (El_Type) then if Default = Null_Iir then Default := Create_Iir (Iir_Kind_Association_Element_Open); end if; Chap5.Elab_Unconstrained_Port_Bounds (El, Default); end if; Chap4.Elab_Signal_Declaration_Storage (El, False); Chap4.Elab_Signal_Declaration_Object (El, Entity, False); Value := Get_Default_Value (El); if Is_Valid (Value) then -- Set default value. Chap9.Destroy_Types (Value); Chap4.Elab_Object_Init (Get_Var (Get_Info (El).Signal_Val, Get_Info (Get_Type (El)), Mode_Value), El, Value, Alloc_System); end if; Close_Temp; El := Get_Chain (El); end loop; Pop_Local_Factory; end Translate_Entity_Init_Ports; procedure Translate_Entity_Declaration (Entity : Iir_Entity_Declaration) is Info : Block_Info_Acc; Interface_List : O_Inter_List; type Subprg_Instance_Array is array (Elab_Kind) of Subprgs.Subprg_Instance_Type; Instance : Subprg_Instance_Array; Prev_Subprg_Instance : Subprgs.Subprg_Instan
import requests
from libpathod import test
def test_simple():
"""
Testing the requests module with
a pathod context manager.
"""
# Start pathod in a separate thread
with test.Daemon() as d:
# Get a URL for a pathod spec
url = d.p("200:b@100")
# ... and request it
r = requests.put(url)
# Check the returned data
assert r.status_code == 200
assert len(r.content) == 100
# Check pathod's internal log
log = d.last_log()["request"]
assert log["method"] == "PUT"