Ejemplo n.º 1
0
 def test_twice_gets_only_first_generator(self):
     blk = get_block("blah", self.double_data, newline=None)
     assert isinstance(blk, collections.Iterator)
     assert list(blk) == ["", "another text", ""]
Ejemplo n.º 2
0
 def test_block_not_found_generator(self):
     blk = get_block("something_not_used", self.data, newline=None)
     assert isinstance(blk, collections.Iterator)
     assert list(blk) == []
Ejemplo n.º 3
0
 def test_twice_gets_only_first(self):
     assert get_block("blah", self.double_data) == "\nanother text\n"
Ejemplo n.º 4
0
 def test_simple_named_block_generator(self):
     blk = get_block("blah", self.data, newline=None)
     assert isinstance(blk, collections.Iterator)
     assert list(blk) == ["", "some text", ""]
Ejemplo n.º 5
0
 def test_block_not_found(self):
     assert get_block("something_not_used", self.data) == ""
Ejemplo n.º 6
0
 def test_simple_named_block(self):
     assert get_block("blah", self.data) == "\nsome text\n"
Ejemplo n.º 7
0
 def test_simple_named_block_custom_newline(self):
     assert get_block("blah", self.data, newline="\r\n") \
            == "\r\nsome text\r\n"
Ejemplo n.º 8
0
 def test_twice_gets_only_first(self):
     assert get_block("blah", self.double_data) == "\nanother text\n"
Ejemplo n.º 9
0
 def test_twice_gets_only_first_generator(self):
     blk = get_block("blah", self.double_data, newline=None)
     assert isinstance(blk, collections.Iterator)
     assert list(blk) == ["", "another text", ""]
Ejemplo n.º 10
0
 def test_block_not_found_generator(self):
     blk = get_block("something_not_used", self.data, newline=None)
     assert isinstance(blk, collections.Iterator)
     assert list(blk) == []
Ejemplo n.º 11
0
 def test_block_not_found(self):
     assert get_block("something_not_used", self.data) == ""
Ejemplo n.º 12
0
 def test_simple_named_block_generator(self):
     blk = get_block("blah", self.data, newline=None)
     assert isinstance(blk, collections.Iterator)
     assert list(blk) == ["", "some text", ""]
Ejemplo n.º 13
0
 def test_simple_named_block_custom_newline(self):
     assert get_block("blah", self.data, newline="\r\n") \
            == "\r\nsome text\r\n"
Ejemplo n.º 14
0
 def test_simple_named_block(self):
     assert get_block("blah", self.data) == "\nsome text\n"