Skip to content

Commit 0a0b541

Browse files
committed
Fix tests after removing noreverse for color conversion initializaiton
1 parent e6b33f3 commit 0a0b541

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

tests/test_pt_utils.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ def test_lex_document_command(self, mock_cmd_app):
117117
tokens = get_line(0)
118118

119119
assert tokens == [
120-
("noreverse fg:ansigreen bg:default", "help"),
120+
("fg:ansigreen bg:default", "help"),
121121
("", " "),
122-
("noreverse fg:ansiyellow bg:default", "something"),
122+
("fg:ansiyellow bg:default", "something"),
123123
]
124124

125125
def test_lex_document_alias(self, mock_cmd_app):
@@ -132,7 +132,7 @@ def test_lex_document_alias(self, mock_cmd_app):
132132
get_line = lexer.lex_document(document)
133133
tokens = get_line(0)
134134

135-
assert tokens == [("noreverse fg:ansicyan bg:default", "ls"), ("", " "), ("noreverse fg:ansired bg:default", "-l")]
135+
assert tokens == [("fg:ansicyan bg:default", "ls"), ("", " "), ("fg:ansired bg:default", "-l")]
136136

137137
def test_lex_document_macro(self, mock_cmd_app):
138138
"""Test lexing a macro."""
@@ -145,9 +145,9 @@ def test_lex_document_macro(self, mock_cmd_app):
145145
tokens = get_line(0)
146146

147147
assert tokens == [
148-
("noreverse fg:ansimagenta bg:default", "my_macro"),
148+
("fg:ansimagenta bg:default", "my_macro"),
149149
("", " "),
150-
("noreverse fg:ansiyellow bg:default", "arg1"),
150+
("fg:ansiyellow bg:default", "arg1"),
151151
]
152152

153153
def test_lex_document_leading_whitespace(self, mock_cmd_app):
@@ -162,9 +162,9 @@ def test_lex_document_leading_whitespace(self, mock_cmd_app):
162162

163163
assert tokens == [
164164
("", " "),
165-
("noreverse fg:ansigreen bg:default", "help"),
165+
("fg:ansigreen bg:default", "help"),
166166
("", " "),
167-
("noreverse fg:ansiyellow bg:default", "something"),
167+
("fg:ansiyellow bg:default", "something"),
168168
]
169169

170170
def test_lex_document_unknown_command(self, mock_cmd_app):
@@ -176,7 +176,7 @@ def test_lex_document_unknown_command(self, mock_cmd_app):
176176
get_line = lexer.lex_document(document)
177177
tokens = get_line(0)
178178

179-
assert tokens == [("", "unknown"), ("", " "), ("noreverse fg:ansiyellow bg:default", "command")]
179+
assert tokens == [("", "unknown"), ("", " "), ("fg:ansiyellow bg:default", "command")]
180180

181181
def test_lex_document_no_command(self, mock_cmd_app):
182182
"""Test lexing an empty line or line with only whitespace."""
@@ -213,17 +213,17 @@ def test_lex_document_arguments(self, mock_cmd_app):
213213
tokens = get_line(0)
214214

215215
assert tokens == [
216-
("noreverse fg:ansigreen bg:default", "help"),
216+
("fg:ansigreen bg:default", "help"),
217217
("", " "),
218-
("noreverse fg:ansired bg:default", "-v"),
218+
("fg:ansired bg:default", "-v"),
219219
("", " "),
220-
("noreverse fg:ansired bg:default", "--name"),
220+
("fg:ansired bg:default", "--name"),
221221
("", " "),
222-
("noreverse fg:ansiyellow bg:default", '"John Doe"'),
222+
("fg:ansiyellow bg:default", '"John Doe"'),
223223
("", " "),
224224
("", ">"),
225225
("", " "),
226-
("noreverse fg:ansiyellow bg:default", "out.txt"),
226+
("fg:ansiyellow bg:default", "out.txt"),
227227
]
228228

229229
def test_lex_document_unclosed_quote(self, mock_cmd_app):
@@ -237,9 +237,9 @@ def test_lex_document_unclosed_quote(self, mock_cmd_app):
237237
tokens = get_line(0)
238238

239239
assert tokens == [
240-
("noreverse fg:ansigreen bg:default", "echo"),
240+
("fg:ansigreen bg:default", "echo"),
241241
("", " "),
242-
("noreverse fg:ansiyellow bg:default", '"hello'),
242+
("fg:ansiyellow bg:default", '"hello'),
243243
]
244244

245245
def test_lex_document_shortcut(self, mock_cmd_app):
@@ -252,13 +252,13 @@ def test_lex_document_shortcut(self, mock_cmd_app):
252252
document = Document(line)
253253
get_line = lexer.lex_document(document)
254254
tokens = get_line(0)
255-
assert tokens == [("noreverse fg:ansigreen bg:default", "!"), ("noreverse fg:ansiyellow bg:default", "ls")]
255+
assert tokens == [("fg:ansigreen bg:default", "!"), ("fg:ansiyellow bg:default", "ls")]
256256

257257
line = "! ls"
258258
document = Document(line)
259259
get_line = lexer.lex_document(document)
260260
tokens = get_line(0)
261-
assert tokens == [("noreverse fg:ansigreen bg:default", "!"), ("", " "), ("noreverse fg:ansiyellow bg:default", "ls")]
261+
assert tokens == [("fg:ansigreen bg:default", "!"), ("", " "), ("fg:ansiyellow bg:default", "ls")]
262262

263263
def test_lex_document_multiline(self, mock_cmd_app):
264264
"""Test lexing a multiline command."""
@@ -272,11 +272,11 @@ def test_lex_document_multiline(self, mock_cmd_app):
272272

273273
# First line should have command
274274
tokens0 = get_line(0)
275-
assert tokens0 == [("noreverse fg:ansigreen bg:default", "orate")]
275+
assert tokens0 == [("fg:ansigreen bg:default", "orate")]
276276

277277
# Second line should have argument (not command)
278278
tokens1 = get_line(1)
279-
assert tokens1 == [("noreverse fg:ansiyellow bg:default", "help")]
279+
assert tokens1 == [("fg:ansiyellow bg:default", "help")]
280280

281281
def test_lexer_set_theme_runtime_update(self, mock_cmd_app):
282282
"""Test that changing the theme updates active lexers."""
@@ -698,7 +698,6 @@ def test_rich_to_pt_style_color(self):
698698
pt_style = pt_utils.rich_to_pt_style(style)
699699
assert "fg:#123456" in pt_style
700700
assert "bg:default" in pt_style
701-
assert "noreverse" in pt_style
702701

703702
def test_rich_to_pt_style_bgcolor(self):
704703
from rich.style import Style

0 commit comments

Comments
 (0)