Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Mar 27, 2020
1 parent 0a1d53e commit f20333d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Test Role 1:
Test Directive 1:
.
```{restructuredtext-test-directive}
```
Expand All @@ -10,7 +10,7 @@ Test Role 1:
.

-----------------------------
Test Role 2:
Test Directive 2:
.
```{restructuredtext-test-directive}
foo
Expand All @@ -25,7 +25,7 @@ foo
.

-----------------------------
Test Role 3:
Test Directive 3:
.
```{restructuredtext-test-directive} foo
```
Expand All @@ -37,7 +37,7 @@ Test Role 3:
.

-----------------------------
Test Role 4:
Test Directive 4:
.
```{restructuredtext-test-directive} foo
bar
Expand All @@ -52,7 +52,7 @@ bar
.

-----------------------------
Test Role 5:
Test Directive 5:
.
```{restructuredtext-test-directive} foo bar
```
Expand All @@ -64,7 +64,7 @@ Test Role 5:
.

-----------------------------
Test Role 6:
Test Directive 6:
.
```{restructuredtext-test-directive} foo bar
baz
Expand All @@ -79,7 +79,7 @@ baz
.

-----------------------------
Test Role 7:
Test Directive 7:
.
```{restructuredtext-test-directive}
Expand All @@ -95,7 +95,7 @@ foo
.

-----------------------------
Test Role Options 1:
Test Directive Options 1:
.
```{restructuredtext-test-directive}
---
Expand All @@ -114,7 +114,7 @@ foo
.

-----------------------------
Test Role Options 2:
Test Directive Options 2:
.
```{restructuredtext-test-directive}
:option1: a
Expand All @@ -131,7 +131,7 @@ foo
.

-----------------------------
Test Role Options Error:
Test Directive Options Error:
.
```{restructuredtext-test-directive}
:option1
Expand All @@ -152,3 +152,20 @@ foo
:option2: b
foo
.


-----------------------------
Unknown Directive:
.
```{unknown}
```
.
<document source="notset">
<system_message level="3" line="1" source="notset" type="ERROR">
<paragraph>
Unknown directive type 'unknown'
<system_message level="1" line="1" source="notset" type="INFO">
<paragraph>
Problem retrieving directive entry from language module 'en': 'str' object has no attribute 'directives'.
Trying "unknown" as canonical directive name.
.
13 changes: 12 additions & 1 deletion tests/test_renderers/fixtures/syntax_elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,19 @@ Heading Levels:
d
.


--------------------------
Block Code:
.
foo
.
<document source="notset">
<literal_block language="none" xml:space="preserve">
foo
.

--------------------------
Fenced Code:
.
```sh
foo
Expand All @@ -117,7 +128,7 @@ foo
.

--------------------------
Block Code no language:
Fenced Code no language:
.
```
foo
Expand Down
4 changes: 2 additions & 2 deletions tests/test_renderers/test_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def test_tables(line, title, input, expected):

@pytest.mark.parametrize(
"line,title,input,expected",
read_fixture_file(FIXTURE_PATH.joinpath("role_options.md")),
read_fixture_file(FIXTURE_PATH.joinpath("directive_options.md")),
)
def test_role_options(line, title, input, expected):
def test_directive_options(line, title, input, expected):
document = to_docutils(input)
print(document.pformat())
assert "\n".join(
Expand Down

0 comments on commit f20333d

Please sign in to comment.