def test_update(self):
        slist = common.StructuredTextList()
        st1 = common.StructuredText("foo", ordinality=1)
        st2 = common.StructuredText("bar", ordinality=2)

        slist.add(st1)
        slist.add(st2)

        new_st1 = common.StructuredText("FOO", ordinality=1)
        new_st2 = common.StructuredText("BAR", ordinality=2)

        newlist = [new_st1, new_st2]
        slist.update(newlist)

        self.assertEqual(slist[1], new_st1)
        self.assertEqual(slist[2], new_st2)
        self.assertTrue(st1 not in slist)
        self.assertTrue(st2 not in slist)
dataset/ETHPy150Open STIXProject/python-stix/stix/test/common/structured_text_tests.py/StructuredTextListTests.test_update/original