def test_get_by_flow(self): flow_id = 1 name = 'test_table' columns = [{'name': 'test', 'type': 'STRING'}] email = '*****@*****.**' in_flow = Flow.create(flow_id, name, columns, email) flow = Flow.get_by_flow(flow_id) self.assertEquals(in_flow.id, flow.id)
def test_create(self): flow_id = 1 name = 'test_table' columns = [{'name': 'test', 'type': 'STRING'}] email = '*****@*****.**' flow = Flow.create(flow_id, name, columns, email) assert flow in db.session self.assertEquals(flow.email, email) self.assertEquals(flow.flow_id, flow_id) self.assertEquals(eval(flow.ft_columns), [x.get('name') for x in columns])