42367e4e33a7c8a19cfacda5a432cc6c44b4ca81,lib/tests/streamlit/delta_generator_test.py,DeltaGeneratorClassTest,test_enqueue_new_element_delta_same_id,#DeltaGeneratorClassTest#,195

Before Change


        self.assertEqual(delta.new_element.text.body, test_data)

    def test_enqueue_new_element_delta_same_id(self):
        queue = MockQueue()
        dg = DeltaGenerator(queue, id=123)
        self.assertEqual(123, dg._id)

        test_data = "some test data"
        // Use FakeDeltaGenerator.fake_text cause if we use
        // DeltaGenerator.text, it calls enqueue_new_element_delta
        // automatically.  Ideally I should unwrap it.
        fake_dg = FakeDeltaGenerator()

        def marshall_element(element):
            fake_dg.fake_text(element, test_data)

        new_dg = dg._enqueue_new_element_delta(marshall_element)
        self.assertEqual(dg, new_dg)

        delta = queue._deltas.pop()
        self.assertEqual(123, delta.id)
        self.assertEqual(delta.new_element.text.body, test_data)

After Change


        new_dg = dg._enqueue_new_element_delta(marshall_element)
        self.assertEqual(dg, new_dg)

        msg = self.queue[-1]
        self.assertEqual(123, msg.delta.id)
        self.assertEqual(msg.delta.new_element.text.body, test_data)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: streamlit/streamlit
Commit Name: 42367e4e33a7c8a19cfacda5a432cc6c44b4ca81
Time: 2019-05-11
Author: thiagot@gmail.com
File Name: lib/tests/streamlit/delta_generator_test.py
Class Name: DeltaGeneratorClassTest
Method Name: test_enqueue_new_element_delta_same_id


Project Name: streamlit/streamlit
Commit Name: 42367e4e33a7c8a19cfacda5a432cc6c44b4ca81
Time: 2019-05-11
Author: thiagot@gmail.com
File Name: lib/tests/streamlit/delta_generator_test.py
Class Name: DeltaGeneratorClassTest
Method Name: test_enqueue_new_element_delta


Project Name: chainer/chainercv
Commit Name: 827e12f3b9506e0f78cc79445441cd9d1f25c055
Time: 2018-04-24
Author: Hakuyume@users.noreply.github.com
File Name: chainercv/links/model/yolo/yolov3.py
Class Name: YOLOv3
Method Name: __call__