Skip to content

Commit

Permalink
Remove commented code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 12, 2023
1 parent f408802 commit 31d38c5
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 114 deletions.
23 changes: 0 additions & 23 deletions cssutils/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,3 @@ def urivalue(uri):
return stringvalue(uri)
else:
return uri


# def normalnumber(num):
# """
# Return normalized number as string.
# """
# sign = ''
# if num.startswith('-'):
# sign = '-'
# num = num[1:]
# elif num.startswith('+'):
# num = num[1:]
#
# if float(num) == 0.0:
# return '0'
# else:
# if num.find('.') == -1:
# return sign + str(int(num))
# else:
# a, b = num.split('.')
# if not a:
# a = '0'
# return '%s%s.%s' % (sign, int(a), b)
3 changes: 0 additions & 3 deletions cssutils/sac.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ def startDocument(self, encoding):
if 'utf-8' != encoding:
self._out.append('@charset "%s";\n' % encoding)

# def comment(self, text, line=None, col=None):
# self._out.append(u'/*%s*/' % text)

def importStyle(self, uri, media, name, line=None, col=None):
"Receive notification of a import statement in the style sheet."
# defaultNamespaceURI???
Expand Down
15 changes: 0 additions & 15 deletions cssutils/tests/test_cssproperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@


class TestCSSProperties:
# def test_cssvalues(self):
# "cssproperties cssvalues"
# # does actually return match object, so a very simplified test...
# match = cssutils.css.cssproperties.cssvalues
#
# self.assertEqual(True, bool(match['color']('red')))
# self.assertEqual(False, bool(match['top']('red')))
#
# self.assertEqual(True, bool(match['left']('0')))
# self.assertEqual(True, bool(match['left']('1px')))
# self.assertEqual(True, bool(match['left']('.1px')))
# self.assertEqual(True, bool(match['left']('-1px')))
# self.assertEqual(True, bool(match['left']('-.1px')))
# self.assertEqual(True, bool(match['left']('-0.1px')))

def test_toDOMname(self):
"cssproperties _toDOMname(CSSname)"
_toDOMname = cssutils.css.cssproperties._toDOMname
Expand Down
23 changes: 0 additions & 23 deletions cssutils/tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,6 @@ def test_normalize(self):
# static too
assert normalize(test) == exp

# def test_normalnumber(self):
# "helper.normalnumber()"
# tests = {
# '0': '0',
# '00': '0',
# '0.0': '0',
# '00.0': '0',
# '1': '1',
# '01': '1',
# '00.1': '0.1',
# '0.00001': '0.00001',
# '-0': '0',
# '-00': '0',
# '-0.0': '0',
# '-00.0': '0',
# '-1': '-1',
# '-01': '-1',
# '-00.1': '-0.1',
# '-0.00001': '-0.00001',
# }
# for test, exp in tests.items():
# self.assertEqual(exp, normalnumber(test))

def test_string(self):
"helper.string()"
assert '"x"' == string('x')
Expand Down
12 changes: 0 additions & 12 deletions cssutils/tests/test_medialist.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,6 @@ def test_item(self):
assert 'screen' == ml.item(1)
assert ml.item(2) is None

# REMOVED special case!
# def test_handheld(self):
# "MediaList handheld"
# ml = cssutils.stylesheets.MediaList()

# ml.mediaText = u' handheld , all '
# self.assertEqual(2, ml.length)
# self.assertEqual(u'handheld, all', ml.mediaText)

# with pytest.raises(xml.dom.InvalidModificationErr, match=self.media_msg('handheld')):
# ml._setMediaText(' handheld , all , tv ')

def test_mediaText(self):
"MediaList.mediaText 2"
tests = {
Expand Down
4 changes: 0 additions & 4 deletions cssutils/tests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ def test_parseComments(self):
p = cssutils.CSSParser(parseComments=True)
assert p.parseString(css).cssText == b'/*1*/\na {\n color: /*2*/ red\n }'

# def test_parseFile(self):
# "CSSParser.parseFile()"
# # see test_cssutils

def test_parseUrl(self):
"CSSParser.parseUrl()"
# parseUrl(self, href, encoding=None, media=None, title=None):
Expand Down
23 changes: 0 additions & 23 deletions cssutils/tests/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,6 @@ def test_init(self):
assert '0' == p.value
assert p.wellformed

# self.assertEqual(True, p.valid)

# def test_valid(self):
# "Property.valid"
# # context property must be set
# tests = [
# ('color', r'INHe\rIT', True),
# ('color', '1', False),
# ('color', 'red', True),
# ('left', '1', False),
# ('left', '1px', True),
# ('font', 'normal 1em/1.5 serif', True),
# ('background', 'url(x.gif) 1 0', False)
# ]
# for n, v, exp in tests:
# v = cssutils.css.CSSValue(cssText=v)
# self.assertTrue(v.wellformed, True)

def test_cssText(self):
"Property.cssText"
p = cssutils.css.property.Property()
Expand Down Expand Up @@ -186,11 +168,6 @@ def test_validate(self):
p.value = 'red'
assert p.valid is False

# def test_cssValue(self):
# "Property.cssValue"
# pass
# # DEPRECATED

def test_priority(self):
"Property.priority"
p = cssutils.css.property.Property('top', '1px', 'important')
Expand Down
11 changes: 0 additions & 11 deletions cssutils/tests/test_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ class TestPreferences(basetest.BaseTestCase):
testcases for cssutils.serialize.Preferences
"""

# def testkeepUnkownAtRules(self):
# "Preferences.keepUnkownAtRules"
# from warnings import catch_warnings
# with catch_warnings(record=True) as log:
# x = cssutils.ser.prefs.keepUnkownAtRules
#
# if log:
# # unpack the only member of log
# warning, = log
# self.assertEqual(warning.category, DeprecationWarning)

def test_resolveVariables(self):
"Preferences.resolveVariables"
assert cssutils.ser.prefs.resolveVariables
Expand Down

0 comments on commit 31d38c5

Please sign in to comment.