Пример #1
0
 def test_empty_Rle(self):
     assert Rle().length() == 0
Пример #2
0
 def test_add_to_empty_rle(self):
     assert Rle().add(1, 3) == Rle([1], [3])
Пример #3
0
 def test_add_implicit_multiplicity(self):
     assert Rle([3, 4], [2, 3]).add(1) == Rle([3, 4, 1], [2, 3, 1])
Пример #4
0
 def test_add_same_as_last(self):
     assert Rle([3, 4]).add(4, 7) == Rle([3, 4], [1, 8])
Пример #5
0
 def test_negative_multiplicity(self):
     with pytest.raises(AssertionError):
         Rle([1, 2, 3]).add(1, -5)
Пример #6
0
 def test_example(self):
     assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).nrun() == 3
Пример #7
0
 def test_add_different_then_last(self):
     assert Rle([3, 4]).add(5, 2) == Rle([3, 4, 5], [1, 1, 2])
Пример #8
0
 def test_example(self):
     assert Rle([1, 1, 3, 4],
                [2, 3, 1, 2]).decode() == [1, 1, 1, 1, 1, 3, 4, 4]
Пример #9
0
 def test_empty_Rle(self):
     assert Rle().end() == []
Пример #10
0
 def test_example(self):
     assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).run_value() == [1, 3, 4]
Пример #11
0
 def test_empty_Rle(self):
     assert Rle().decode() == []
Пример #12
0
 def test_empty_Rle(self):
     assert Rle().run_value() == []
Пример #13
0
 def test_example(self):
     assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).start() == [1, 6, 7]
Пример #14
0
 def test_empty_Rle(self):
     assert Rle().start() == []
Пример #15
0
 def test_empty_Rle(self):
     assert Rle().run_length() == []
Пример #16
0
 def test_example(self):
     assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).end() == [5, 6, 8]
Пример #17
0
 def test_example(self):
     assert Rle([1, 1, 3, 4], [2, 3, 1, 2]).run_length() == [5, 1, 2]
Пример #18
0
 def test_empty_Rle(self):
     assert Rle().nrun() == 0