Exemplo n.º 1
0
	def test_collapse_to_valuesonly(self):
		""" Test the Collapse to Export Values Only (collapse_to_valuesonly()) Against Some Random Test Cases Across ALL Years """
		rs = convert_import_excel_to_statatypes(TEST_DATA_DIR+'testdata_collapse_to_valuesonly_2_result.xlsx')
		obj = self.obj
		obj.collapse_to_valuesonly()
		assert_rows_in_df(df=obj.dataset, rows=rs)
		assert_unique_rows_in_df(df=obj.dataset, rows=rs)
Exemplo n.º 2
0
 def test_collapse_to_valuesonly(self):
     """ Test the Collapse to Export Values Only (collapse_to_valuesonly()) Against Some Random Test Cases Across ALL Years """
     rs = convert_import_excel_to_statatypes(
         TEST_DATA_DIR + 'testdata_collapse_to_valuesonly_2_result.xlsx')
     obj = self.obj
     obj.collapse_to_valuesonly()
     assert_rows_in_df(df=obj.dataset, rows=rs)
     assert_unique_rows_in_df(df=obj.dataset, rows=rs)
Exemplo n.º 3
0
	def test_collapse_to_valuesonly_1990(self):
		""" Test the Collapse to Export Values Only (collapse_to_valuesonly()) Against Some Random Test Cases in Year 1990 """
		obj = self.obj
		obj.set_dataset(obj.raw_data)
		obj.collapse_to_valuesonly()
		rs = convert_import_excel_to_statatypes(TEST_DATA_DIR+'testdata_collapse_to_valuesonly_1_result.xlsx')
		assert_rows_in_df(df=obj.dataset, rows=rs)
		assert_unique_rows_in_df(df=obj.dataset, rows=rs)
Exemplo n.º 4
0
 def test_collapse_to_valuesonly_1990(self):
     """ Test the Collapse to Export Values Only (collapse_to_valuesonly()) Against Some Random Test Cases in Year 1990 """
     obj = self.obj
     obj.set_dataset(obj.raw_data)
     obj.collapse_to_valuesonly()
     rs = convert_import_excel_to_statatypes(
         TEST_DATA_DIR + 'testdata_collapse_to_valuesonly_1_result.xlsx')
     assert_rows_in_df(df=obj.dataset, rows=rs)
     assert_unique_rows_in_df(df=obj.dataset, rows=rs)
Exemplo n.º 5
0
	def test_random_sample_2000(self):
		""" 
		Test a Random Sample from 2000
		File: 'data/nberfeenstra_wtf00_random_sample.csv' (md5hash: ???)
		Dependancies: import_csv_as_statatypes()
		"""
		#-Load Random Sample From RAW DATASET-#
		years = [2000]
		rs = import_csv_as_statatypes(TEST_DATA_DIR+"nberfeenstra_wtf00_random_sample.csv") 		#random sample
		del rs['obs']
		assert_rows_in_df(df=self.obj.raw_data, rows=rs)
		assert_unique_rows_in_df(df=self.obj.raw_data, rows=rs)
Exemplo n.º 6
0
	def test_random_sample_1962(self):
		""" 
		Test a Random Sample from 1962
		File: 'data/nberfeenstra_wtf62_random_sample.csv' (md5hash: da092cc4b8053083d53c5dc5b72df79d)
		Dependancies: import_csv_as_statatypes()
		"""
		#-Load Random Sample From RAW DATASET-#
		years = [1962]
		obj = self.obj
		rs = import_csv_as_statatypes(TEST_DATA_DIR+"nberfeenstra_wtf62_random_sample.csv") 		#random sample
		del rs['obs']
		assert_rows_in_df(df=self.obj.raw_data, rows=rs)
		assert_unique_rows_in_df(df=self.obj.raw_data, rows=rs)
Exemplo n.º 7
0
    def test_random_sample_2000(self):
        """ 
		Test a Random Sample from 2000
		File: 'data/nberfeenstra_wtf00_random_sample.csv' (md5hash: ???)
		Dependancies: import_csv_as_statatypes()
		"""
        #-Load Random Sample From RAW DATASET-#
        years = [2000]
        rs = import_csv_as_statatypes(
            TEST_DATA_DIR +
            "nberfeenstra_wtf00_random_sample.csv")  #random sample
        del rs['obs']
        assert_rows_in_df(df=self.obj.raw_data, rows=rs)
        assert_unique_rows_in_df(df=self.obj.raw_data, rows=rs)
Exemplo n.º 8
0
    def test_random_sample_1962(self):
        """ 
		Test a Random Sample from 1962
		File: 'data/nberfeenstra_wtf62_random_sample.csv' (md5hash: da092cc4b8053083d53c5dc5b72df79d)
		Dependancies: import_csv_as_statatypes()
		"""
        #-Load Random Sample From RAW DATASET-#
        years = [1962]
        obj = self.obj
        rs = import_csv_as_statatypes(
            TEST_DATA_DIR +
            "nberfeenstra_wtf62_random_sample.csv")  #random sample
        del rs['obs']
        assert_rows_in_df(df=self.obj.raw_data, rows=rs)
        assert_unique_rows_in_df(df=self.obj.raw_data, rows=rs)