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