Skip to content

Commit

Permalink
add tests for Stata 14 files from Brooke #2301
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed May 31, 2018
1 parent 97a7853 commit 06ef690
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,36 @@ public void testStrls() throws Exception {
assertEquals(13, result.getDataTable().getDataVariables().size());
}

@Ignore
@Test
public void testBrooke3079508() throws IOException {
// https://dataverse.harvard.edu/file.xhtml?fileId=3079508 Stata 14: Brooke_Ketchley_APSR_replicationII.dta
TabularDataIngest result = instance.read(new BufferedInputStream(new FileInputStream(new File("/tmp/Brooke_Ketchley_APSR_replicationII.dta"))), nullDataFile);
assertEquals("application/x-stata", result.getDataTable().getOriginalFileFormat());
assertEquals("STATA 14", result.getDataTable().getOriginalFormatVersion());
assertEquals(2, result.getDataTable().getDataVariables().size());
DataVariable year = result.getDataTable().getDataVariables().get(0);
assertEquals("year", year.getName());
assertEquals("year", year.getLabel());
DataVariable missionaries = result.getDataTable().getDataVariables().get(1);
assertEquals("missionaries", missionaries.getName());
assertEquals("Number of Church Missionary Society missionaries", missionaries.getLabel());
}

@Ignore
@Test
public void testBrooke3079511() throws IOException {
// https://dataverse.harvard.edu/file.xhtml?fileId=3079511 Stata 14: Brooke_Ketchley_APSR_replicationI.dta
TabularDataIngest result = instance.read(new BufferedInputStream(new FileInputStream(new File("/tmp/Brooke_Ketchley_APSR_replicationI.dta"))), nullDataFile);
assertEquals("application/x-stata", result.getDataTable().getOriginalFileFormat());
assertEquals("STATA 14", result.getDataTable().getOriginalFormatVersion());
assertEquals(40, result.getDataTable().getDataVariables().size());
DataVariable muhafatha = result.getDataTable().getDataVariables().get(0);
assertEquals("muhafatha", muhafatha.getName());
assertEquals("muhafatha", muhafatha.getLabel());
DataVariable qism = result.getDataTable().getDataVariables().get(1);
assertEquals("qism", qism.getName());
assertEquals("qism", qism.getLabel());
}

}

0 comments on commit 06ef690

Please sign in to comment.