Skip to content

Commit

Permalink
add test cases to increase code coverage for parse_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ikirudennis committed Aug 7, 2024
1 parent 52c1b8a commit 164c09e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_attributes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import OrderedDict
from textile.utils import parse_attributes


Expand All @@ -13,3 +14,11 @@ def test_parse_attributes():
assert parse_attributes('<') == {'style': 'text-align:left;'}
assert parse_attributes('(c#i)') == {'class': 'c', 'id': 'i'}
assert parse_attributes('\\2 100', element='col') == {'span': '2', 'width': '100'}


def test_parse_attributes_edge_cases():
result = parse_attributes('(:c#i)')
expect = OrderedDict({'id': 'i'})
assert result == expect

assert parse_attributes('(<)') == OrderedDict()

0 comments on commit 164c09e

Please sign in to comment.