// Make sure it has 2 rows in it.
df_proto = data_frame_proto._get_data_frame(
self._report_queue._queue[-1].delta)
num_rows = len(df_proto.data.cols[0].int64s.data)
self.assertEqual(num_rows, 2)
// This is what we"re testing:
self._report_queue.clear()
el.add_rows(NEW_ROWS)
// Make sure there are 3 rows in the delta that got appended.
ar = self._report_queue._queue[-1].delta.add_rows
num_rows = len(ar.data.data.cols[0].int64s.data)
self.assertEqual(num_rows, 3)
// Clear the queue so the next loop is like a brand new test.
After Change
self._dg._reset()
self.report_queue.clear()
def test_simple_add_rows_with_clear_queue(self):
Test plain old add_rows after clearing the queue.
all_methods = (
self._get_unnamed_data_methods() + self._get_named_data_methods())
for method in all_methods:
// Create a new data-carrying element (e.g. st.dataframe)
el = method(DATAFRAME)
// Make sure it has 2 rows in it.
df_proto = data_frame_proto._get_data_frame(
self.get_delta_from_queue())
num_rows = len(df_proto.data.cols[0].int64s.data)
self.assertEqual(num_rows, 2)
// This is what we"re testing:
self.report_queue.clear()
el.add_rows(NEW_ROWS)
// Make sure there are 3 rows in the delta that got appended.
ar = self.get_delta_from_queue().add_rows
num_rows = len(ar.data.data.cols[0].int64s.data)
self.assertEqual(num_rows, 3)
// Clear the queue so the next loop is like a brand new test.