diff --git a/src/ImportComp.jl b/src/ImportComp.jl index 5baebbe..185db0e 100644 --- a/src/ImportComp.jl +++ b/src/ImportComp.jl @@ -186,7 +186,7 @@ const compd_funda = [ "ISNGC", "ISNGM", "ISOTC", "ISOTH", "ISOTM", "ISSC", "ISSM", "ISSU", "IST", "ISTC", "ISTM", "ISUT", "ITCB", "ITCC", "ITCI", "IVACO", "IVAEQ", "IVAO", "IVCH", "IVGOD", "IVI", "IVNCF", "IVPT", "IVST", "IVSTCH", "LCABG", "LCACL", "LCACR", "LCAG", "LCAL", "LCALT", "LCAM", "LCAO", "LCAST", "LCAT", "LCO", "LCOX", "LCOXAR", "LCOXDR", "LCT", "LCUACU", "LI", "LIF", "LIFR", "LIFRP", "LLOML", "LLOO", "LLOT", "LLRCI", "LLRCR", "LLWOCI", "LLWOCR", "LNO", "LO", "LOL2", "LOXDR", "LQPL1", "LRV", "LS", "LSE", "LST", - "LT", "LUL3", "MIB", "MIBN", "MIBT", "MII", "MRC1", "MRC2", "MRC3", "MRC4", "MRC5", "MRCT", "MRCTA", "MSA", "MSVRV", "MTL", "NAICS", "NAT", "NCO", "NFSR", "NI", "NIADJ", "NIECI", + "LT", "LUL3", "MIB", "MIBN", "MIBT", "MII", "MRC1", "MRC2", "MRC3", "MRC4", "MRC5", "MRCT", "MRCTA", "MSA", "MSVRV", "MTL", "NAT", "NCO", "NFSR", "NI", "NIADJ", "NIECI", "NIINT", "NIINTPFC", "NIINTPFP", "NIIT", "NIM", "NIO", "NIPFC", "NIPFP", "NIT", "NITS", "NOPI", "NOPIO", "NP", "NPANL", "NPAORE", "NPARL", "NPAT", "NRTXT", "NRTXTD", "NRTXTEPS", "OANCF", "OB", "OIADP", "OIBDP", "OPEPS", "OPILI", "OPINCAR", "OPINI", "OPIOI", "OPIRI", "OPITI", "OPREPSX", "OPTCA", "OPTDR", "OPTEX", "OPTEXD", "OPTFVGR", "OPTGR", "OPTLIFE", "OPTOSBY", "OPTOSEY", "OPTPRCBY", "OPTPRCCA", "OPTPRCEX", "OPTPRCEY", "OPTPRCGR", "OPTPRCWA", "OPTRFR", "OPTVOL", "PALR", "PANLR", "PATR", "PCL", diff --git a/test/runtests.jl b/test/runtests.jl index 5b7a684..acfc81e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,14 +1,14 @@ -# --------------------------------------------------------- +# -------------------------------------------------------------------------------------------------- using FinanceRoutines using Test import DataFrames: DataFrame, nrow, rename! -import Dates: Date +import Dates: Date, year import LibPQ: Connection -# --------------------------------------------------------- +# -------------------------------------------------------------------------------------------------- -# --------------------------------------------------------- +# -------------------------------------------------------------------------------------------------- @testset "FinanceRoutines.jl" begin # Write your tests here. @@ -42,7 +42,7 @@ import LibPQ: Connection wrds_conn = FinanceRoutines.open_wrds_pg(WRDS_USERNAME, WRDS_PWD) @test typeof(wrds_conn) == Connection - @testset "MSF" begin + @testset "CRSP MSF" begin df_msf = import_MSF(wrds_conn; date_range = (Date("2000-01-01"), Date("2002-01-01"))); build_MSF!(df_msf; clean_cols=true); @@ -51,7 +51,23 @@ import LibPQ: Connection @test nrow(df_msf) > 100_000 end + @testset "Compustat FUNDA" begin + df_funda = import_Funda(wrds_conn; + date_range = (Date("2000-01-01"), Date("2002-01-01")), + variables=["PPENT", "NAICSH", "NAICS"]) + build_Funda!(df_funda; clean_cols=true) + + # check basic properties of the DataFrame (mainly that it has downloaded) + @test minimum(skipmissing(df_funda.datey)) >= year(Date("2000-01-01")) + @test maximum(skipmissing(df_funda.datey)) <= year(Date("2002-01-01")) + @test nrow(df_funda) > 20_000 + + # check that the variables are downloaded and in the dataframe + @test all(map(s -> s in names(df_funda), lowercase.(["PPENT", "NAICSH"]))) + + end + end end -# --------------------------------------------------------- +# --------------------------------------------------------------------------------------------------