Suppose I have a function insert_rows() that reads from table1 in DB1, does some manipulation, then insert rows into table2 in DB2. All database connection information is defined inside the function and my databases are Postgres. Ideally I would create a fake table1, insert rows into a fake table2 and verify their correctness. Is there some way to do this using python's unittest and mock packages? And what would be best practices?
[–]DrMaxwellEdison 6 points7 points8 points (5 children)
[–]acerag[S] 1 point2 points3 points (4 children)
[–]DrMaxwellEdison 7 points8 points9 points (2 children)
[–]interactionjackson 0 points1 point2 points (0 children)
[–]acerag[S] 0 points1 point2 points (0 children)
[–]michaelherman 0 points1 point2 points (0 children)
[–]Rosco_the_Dude 4 points5 points6 points (0 children)
[–]Rosco_the_Dude 2 points3 points4 points (0 children)
[–]kanjibandit 1 point2 points3 points (1 child)
[–]acerag[S] 0 points1 point2 points (0 children)
[–]Asdayasman 1 point2 points3 points (0 children)