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