Exemplo n.º 1
0
 def test_db_writer(self):
     writer = DatabaseWriter(self.db, "dst")
     writer.table.delete("1=1")
     writer.write(self.get_dataset(self.dst_record))
     task = Task(DatabaseReader(self.db, "dst"))
     self.assertEqual(task.dataset.get_all(),
                      self.get_dataset(self.dst_record).get_all())
Exemplo n.º 2
0
 def test_db_reader_by_con(self):
     con = self.db.driver.con
     writer = DatabaseWriter(con, "dst")
     writer.table.delete("1=1")
     writer.write(self.get_dataset(self.dst_record))
     task = Task(DatabaseReader(self.db, "dst"))
     self.assertEqual(task.dataset.get_all(),
                      self.get_dataset(self.dst_record).get_all())
Exemplo n.º 3
0
 def test_db_reader_by_engine(self):
     engine = self.db.driver.engine
     reader = DatabaseReader(engine, "src")
     self.validate(reader)
Exemplo n.º 4
0
 def test_db_reader(self):
     reader = DatabaseReader(self.db, "src")
     self.validate(reader)
Exemplo n.º 5
0
 def test_dict_columns(self):
     reader = DatabaseReader(self.db, "src")
     task = Task(reader, columns=self.columns)
     self.assertEqual(task.dataset.get_all(),
                      self.get_dataset(self.dst_record).get_all())
Exemplo n.º 6
0
 def test_set_columns(self):
     reader = DatabaseReader(self.db, "src")
     task = Task(reader, columns={"uuid"})
     self.assertEqual(task.dataset.get_all(), [{"uuid": 1}])
Exemplo n.º 7
0
 def test_no_columns(self):
     reader = DatabaseReader(self.db, "src")
     task = Task(reader)
     self.assertEqual(task.dataset.get_all(), [self.src_record])
Exemplo n.º 8
0
 def test_hive_writer(self):
     writer = HiveWriter(self.db, "dst")
     writer.write(self.get_dataset(self.dst_record))
     task = Task(DatabaseReader(self.db, "dst"))
     self.assertEqual(task.dataset.get_all(),
                      self.get_dataset(self.dst_record).get_all())