|
14 | 14 |
|
15 | 15 | from mock import call, create_autospec, Mock |
16 | 16 |
|
17 | | -from .oxml.unitdata.text import a_b, a_br, a_t, a_p, an_r, an_rPr |
| 17 | +from .oxml.unitdata.text import a_b, a_br, a_t, a_p, an_i, an_r, an_rPr |
18 | 18 | from .unitutil import class_mock |
19 | 19 |
|
20 | 20 |
|
@@ -94,6 +94,10 @@ def it_knows_if_its_bold(self, bold_get_fixture): |
94 | 94 | run, is_bold = bold_get_fixture |
95 | 95 | assert run.bold == is_bold |
96 | 96 |
|
| 97 | + def it_knows_if_its_italic(self, italic_get_fixture): |
| 98 | + run, is_italic = italic_get_fixture |
| 99 | + assert run.italic == is_italic |
| 100 | + |
97 | 101 | def it_can_change_its_bold_setting(self, bold_set_fixture): |
98 | 102 | run, bold_value, expected_xml = bold_set_fixture |
99 | 103 | run.bold = bold_value |
@@ -160,6 +164,20 @@ def bold_get_fixture(self, request): |
160 | 164 | run = Run(r) |
161 | 165 | return run, is_bold |
162 | 166 |
|
| 167 | + @pytest.fixture(params=[True, False, None]) |
| 168 | + def italic_get_fixture(self, request): |
| 169 | + is_italic = request.param |
| 170 | + r_bldr = an_r().with_nsdecls() |
| 171 | + if is_italic is not None: |
| 172 | + i_bldr = an_i() |
| 173 | + if is_italic is False: |
| 174 | + i_bldr.with_val('off') |
| 175 | + rPr_bldr = an_rPr().with_child(i_bldr) |
| 176 | + r_bldr.with_child(rPr_bldr) |
| 177 | + r = r_bldr.element |
| 178 | + run = Run(r) |
| 179 | + return run, is_italic |
| 180 | + |
163 | 181 | @pytest.fixture(params=[True, False, None]) |
164 | 182 | def bold_set_fixture(self, request): |
165 | 183 | # run -------------------------- |
|
0 commit comments