Skip to content

Commit

Permalink
Revive more commented code and mark the tests as xfail.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 12, 2023
1 parent 0dfc5f7 commit 161b297
Showing 1 changed file with 39 additions and 22 deletions.
61 changes: 39 additions & 22 deletions cssutils/tests/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,26 +701,43 @@ def test_validate(self):
# list(profile),
# ) == cssutils.profile.validateWithProfile(name, value)

def _gen_validation_inputs():
yield (
(FM3FF, 'font-family', ('y', '"y"')),
( # => name should be "y"!!!
True,
True,
FM3FF,
),
)
yield ((FM3FF, 'font-family', ('"y", "a"', 'a, b', 'a a')), (True, False, CSS2))
yield (
(FM3FF, 'font-stretch', ('normal', 'wider', 'narrower', 'inherit')),
(
True,
False,
FM3,
),
)
yield ((FM3FF, 'font-style', ('inherit',)), (True, False, CSS2))
yield (
(
FM3FF,
'font-weight',
(
'bolder',
'lighter',
'inherit',
),
),
(True, False, CSS2),
)

# TODO: fix
# def test_validateByProfile(self):
# "Profiles.validateByProfile()"
# # testing for valid values overwritten in a profile
# tests = {
# (FM3FF, 'font-family', ('y', '"y"' # => name should be "y"!!!
# )): (True, True, FM3FF),
# (FM3FF, 'font-family', ('"y", "a"', 'a, b', 'a a'
# )): (True, False, CSS2),
# (FM3FF, 'font-stretch', ('normal', 'wider', 'narrower', 'inherit'
# )): (True, False, FM3),
# (FM3FF, 'font-style', ('inherit',
# )): (True, False, CSS2),
# (FM3FF, 'font-weight', ('bolder', 'lighter', 'inherit',
# )): (True, False, CSS2),
# }
# for (profiles, name, values), (v, m, p) in tests.items():
# for value in values:
# self.assertEqual((v, m, list(p)),
# cssutils.profile.validateWithProfile(name,
# value,
# profiles))
@pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
@pytest.mark.xfail(reason="#37")
def test_validateWithProfile_fonts(self, params, results):
"Profiles.validateWithProfile()"
# testing for valid values overwritten in a profile
v, m, p = results
expected = v, m, list(p)
assert cssutils.profile.validateWithProfile(*params) == expected

0 comments on commit 161b297

Please sign in to comment.