summaryrefslogtreecommitdiff
path: root/tests/test_directive_code.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-22 00:29:24 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-22 00:29:24 +0900
commit675b5f4237a3482f298ecfe13291660fee37e26d (patch)
tree39a93096d9d4d68a3e6d90a6d5f0a05ecc1b338f /tests/test_directive_code.py
parent3eb5b2960a90583ffc3173cd981fadfd678f5500 (diff)
downloadsphinx-git-675b5f4237a3482f298ecfe13291660fee37e26d.tar.gz
literalinclude directive allows combination of :pyobject: and :lines:
Diffstat (limited to 'tests/test_directive_code.py')
-rw-r--r--tests/test_directive_code.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_directive_code.py b/tests/test_directive_code.py
index c1d476250..f2ca9f040 100644
--- a/tests/test_directive_code.py
+++ b/tests/test_directive_code.py
@@ -65,6 +65,14 @@ def test_LiteralIncludeReader_pyobject3():
" pass\n")
+def test_LiteralIncludeReader_pyobject_and_lines():
+ options = {'pyobject': 'Bar', 'lines': '2-'}
+ reader = LiteralIncludeReader(LITERAL_INC_PATH, options, DUMMY_CONFIG)
+ content, lines = reader.read()
+ assert content == (" def baz():\n"
+ " pass\n")
+
+
def test_LiteralIncludeReader_lines1():
options = {'lines': '1-4'}
reader = LiteralIncludeReader(LITERAL_INC_PATH, options, DUMMY_CONFIG)