|
@@ -2,6 +2,7 @@ import unittest
|
|
|
import sys
|
|
|
import os
|
|
|
import pandas as pd
|
|
|
+from pprint import pprint
|
|
|
sys.path.append(os.getcwd())
|
|
|
from cdplib.log import Log
|
|
|
from cdplib.FlattenData import FlattenData
|
|
@@ -34,8 +35,8 @@ class TestMongodbHandler(unittest.TestCase):
|
|
|
|
|
|
flattened_dict = self.flattener.flatten(nested_data_dict)
|
|
|
flattened_list = self.flattener.flatten(nested_data_list)
|
|
|
- flattened_df = self.flattener.flatten(nested_data_df)
|
|
|
-
|
|
|
+ flattened_df = self.flattener.flatten(nested_data_df)
|
|
|
+
|
|
|
self.assertEqual(nested_data_dict["two_levels"]["one_level"], flattened_dict.loc['two_levels_one_level', 0])
|
|
|
self.assertEqual(nested_data_dict["two_levels"]["one_level"], flattened_list.loc['0_two_levels_one_level', 0])
|
|
|
self.assertEqual(nested_data_dict["two_levels"]["one_level"], flattened_df.loc[0 , 'two_levels_one_level'])
|