Example #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", ""]
Example #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) == []
Example #3
0
 def test_twice_gets_only_first(self):
     assert get_block("blah", self.double_data) == "\nanother text\n"
Example #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", ""]
Example #5
0
 def test_block_not_found(self):
     assert get_block("something_not_used", self.data) == ""
Example #6
0
 def test_simple_named_block(self):
     assert get_block("blah", self.data) == "\nsome text\n"
Example #7
0
 def test_simple_named_block_custom_newline(self):
     assert get_block("blah", self.data, newline="\r\n") \
            == "\r\nsome text\r\n"
Example #8
0
 def test_twice_gets_only_first(self):
     assert get_block("blah", self.double_data) == "\nanother text\n"
Example #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", ""]
Example #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) == []
Example #11
0
 def test_block_not_found(self):
     assert get_block("something_not_used", self.data) == ""
Example #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", ""]
Example #13
0
 def test_simple_named_block_custom_newline(self):
     assert get_block("blah", self.data, newline="\r\n") \
            == "\r\nsome text\r\n"
Example #14
0
 def test_simple_named_block(self):
     assert get_block("blah", self.data) == "\nsome text\n"