99ac030ac2eac3a8f3b8b9977558c930387de693,lib/tests/streamlit/add_rows_test.py,DeltaGeneratorAddRowsTest,test_simple_add_rows_with_clear_queue,#DeltaGeneratorAddRowsTest#,89

Before Change



            // 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.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 16

Instances


Project Name: streamlit/streamlit
Commit Name: 99ac030ac2eac3a8f3b8b9977558c930387de693
Time: 2019-05-14
Author: thiagot@gmail.com
File Name: lib/tests/streamlit/add_rows_test.py
Class Name: DeltaGeneratorAddRowsTest
Method Name: test_simple_add_rows_with_clear_queue


Project Name: streamlit/streamlit
Commit Name: 99ac030ac2eac3a8f3b8b9977558c930387de693
Time: 2019-05-14
Author: thiagot@gmail.com
File Name: lib/tests/streamlit/add_rows_test.py
Class Name: DeltaGeneratorAddRowsTest
Method Name: test_named_add_rows_with_clear_queue


Project Name: streamlit/streamlit
Commit Name: 99ac030ac2eac3a8f3b8b9977558c930387de693
Time: 2019-05-14
Author: thiagot@gmail.com
File Name: lib/tests/streamlit/delta_generator_test.py
Class Name: DeltaGeneratorProgressTest
Method Name: test_progress_bad_values


Project Name: streamlit/streamlit
Commit Name: 99ac030ac2eac3a8f3b8b9977558c930387de693
Time: 2019-05-14
Author: thiagot@gmail.com
File Name: lib/tests/streamlit/delta_generator_test.py
Class Name: DeltaGeneratorImageTest
Method Name: test_image_from_url