コード例 #1
0
    def test_retain_delta_lengths(self):
        delta = Delta().retain(1)
        assert delta.length() == 1

        delta = Delta().retain(10)
        assert delta.length() == 10

        delta = Delta().retain(10).retain(10).retain(10)
        assert delta.length() == 30
コード例 #2
0
    def test_insert_lengths(self):
        delta = Delta().insert('test')
        assert delta.length() == 4

        delta = Delta().insert(1)
        assert delta.length() == 1

        delta = Delta().insert({'url': 'https://google.com/'})
        assert delta.length() == 1
コード例 #3
0
    def test_delete_delta_lengths(self):
        delta = Delta().delete(1)
        assert delta.length() == 1

        delta = Delta().delete(10)
        assert delta.length() == 10

        delta = Delta().delete(10).delete(10).delete(10)
        assert delta.length() == 30