korusdipl / grit-i18n

Automatically exported from code.google.com/p/grit-i18n
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Several unit tests failing on Windows #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
======================================================================
ERROR: Tests that ".src=" doesn't treat as a tag.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\format\html_inline_unittest.py", line 95, in testCompressedJavaScript
    resources = html_inline.GetResourceFilenames(tmp_dir.GetPath('index.js'))
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 378, in GetResourceFilenames
    rewrite_function=rewrite_function).inlined_files
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests that all included files are returned by GetResourceFilenames.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\format\html_inline_unittest.py", line 76, in testGetResourceFilenames
    resources = html_inline.GetResourceFilenames(tmp_dir.GetPath('index.html'))
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 378, in GetResourceFilenames
    rewrite_function=rewrite_function).inlined_files
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests that @import directives in inlined CSS files are inlined too.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\format\html_inline_unittest.py", line 149, in testInlineCSSImports
    result = html_inline.DoInline(tmp_dir.GetPath('index.html'), None)
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests that only CSS files referenced via relative URLs are inlined.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\format\html_inline_unittest.py", line 197, in testInlineCSSLinks
    result = html_inline.DoInline(tmp_dir.GetPath('index.html'), None)
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: testChromeHtmlNodeOutputfile (grit.format.rc_unittest.FormatRcUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\format\rc_unittest.py", line 269, in testChromeHtmlNodeOutputfile
    root.RunGatherers()
  File "S:\src\grit-i18n\grit\node\misc.py", line 471, in RunGatherers
    node.RunPreSubstitutionGatherer(debug=debug)
  File "S:\src\grit-i18n\grit\node\structure.py", line 192, in RunPreSubstitutionGatherer
    self.gatherer.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: testRcIncludeFlattenedHtmlFile (grit.format.rc_unittest.FormatRcUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\format\rc_unittest.py", line 206, in testRcIncludeFlattenedHtmlFile
    buf)
  File "S:\src\grit-i18n\grit\tool\build.py", line 205, in ProcessNode
    outfile.writelines(formatted)
  File "C:\python_26_amd64\files\lib\StringIO.py", line 250, in writelines
    for line in iterable:
  File "S:\src\grit-i18n\grit\format\rc.py", line 35, in Format
    yield FormatInclude(item, lang, output_dir)
  File "S:\src\grit-i18n\grit\format\rc.py", line 433, in FormatInclude
    filename = item.Process(output_dir)
  File "S:\src\grit-i18n\grit\node\include.py", line 104, in Process
    outfile.write(self._GetFlattenedData())
  File "S:\src\grit-i18n\grit\node\include.py", line 38, in _GetFlattenedData
    allow_external_script=allow_external_script))
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests inlined image file resources with available high DPI assets.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_html_unittest.py", line 66, in testFileResources
    html.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests inlined image file resources if url() filename is double quoted.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_html_unittest.py", line 166, in testFileResourcesDoubleQuotes
    html.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests inlined image file resources with available high DPI assets on
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_html_unittest.py", line 107, in testFileResourcesImageTag
    html.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests inlined image file resources without available high DPI assets.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_html_unittest.py", line 230, in testFileResourcesNoFile
    html.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests inlined image file resources when url() filename is unquoted.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_html_unittest.py", line 193, in testFileResourcesNoQuotes
    html.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests removing an unsupported scale factor from an explicit image-set.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_html_unittest.py", line 328, in testRemoveUnsupportedScale
    html.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
ERROR: Tests inserting high DPI chrome://theme references.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_html_unittest.py", line 275, in testThemeResources
    html.Parse()
  File "S:\src\grit-i18n\grit\gather\chrome_html.py", line 290, in Parse
    rewrite_function=lambda fp, t, d: ProcessImageSets(
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 344, in InlineToString
    rewrite_function=rewrite_function).inlined_data
  File "S:\src\grit-i18n\grit\format\html_inline.py", line 306, in DoInline
    flat_text)
  File "C:\python_26_amd64\files\lib\re.py", line 151, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python_26_amd64\files\lib\re.py", line 241, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

======================================================================
FAIL: testLowresFallback 
(grit.gather.chrome_scaled_image_unittest.ChromeScaledImageUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 162, in testLowresFallback
    _RunBuildTest(*args, skip_rc=True)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 109, in _RunBuildTest
    build.RcBuilder().Run(options, [])
  File "S:\src\grit-i18n\grit\tool\build.py", line 149, in Run
    self.Process()
  File "S:\src\grit-i18n\grit\tool\build.py", line 268, in Process
    self.ProcessNode(self.res, output, outfile)
  File "S:\src\grit-i18n\grit\tool\build.py", line 204, in ProcessNode
    formatted = formatter(node, output_node.GetLanguage(), output_dir=base_dir)
  File "S:\src\grit-i18n\grit\format\data_pack.py", line 46, in Format
    id, value = node.GetDataPackPair(lang, UTF8)
  File "S:\src\grit-i18n\grit\node\structure.py", line 168, in GetDataPackPair
    data = self.gatherer.GetData(lang, encoding)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 136, in GetData
    data = _MoveSpecialChunksToFront(data)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 53, in _MoveSpecialChunksToFront
    for chunk in _ChunkifyPNG(data):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 67, in _ChunkifyPNG
    assert data.startswith(_PNG_MAGIC)
AssertionError

======================================================================
FAIL: testNormalFallback 
(grit.gather.chrome_scaled_image_unittest.ChromeScaledImageUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 134, in testNormalFallback
    'tactile_123_percent': set([t123a, d123b]),
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 109, in _RunBuildTest
    build.RcBuilder().Run(options, [])
  File "S:\src\grit-i18n\grit\tool\build.py", line 149, in Run
    self.Process()
  File "S:\src\grit-i18n\grit\tool\build.py", line 268, in Process
    self.ProcessNode(self.res, output, outfile)
  File "S:\src\grit-i18n\grit\tool\build.py", line 204, in ProcessNode
    formatted = formatter(node, output_node.GetLanguage(), output_dir=base_dir)
  File "S:\src\grit-i18n\grit\format\data_pack.py", line 46, in Format
    id, value = node.GetDataPackPair(lang, UTF8)
  File "S:\src\grit-i18n\grit\node\structure.py", line 168, in GetDataPackPair
    data = self.gatherer.GetData(lang, encoding)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 136, in GetData
    data = _MoveSpecialChunksToFront(data)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 53, in _MoveSpecialChunksToFront
    for chunk in _ChunkifyPNG(data):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 67, in _ChunkifyPNG
    assert data.startswith(_PNG_MAGIC)
AssertionError

======================================================================
FAIL: testGetPathNoBasedir (grit.node.include_unittest.IncludeNodeUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\node\include_unittest.py", line 70, in testGetPathNoBasedir
    os.path.join(ur'../', ur'flugel/kugel.pdf')))
AssertionError: u'..\\grit-i18n\\flugel\\kugel.pdf' != u'..\\flugel\\kugel.pdf'

======================================================================
FAIL: testOutputs (grit.tool.android2grd_unittest.Android2GrdUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\tool\android2grd_unittest.py", line 166, in testOutputs
    'header/dir/chrome_android_strings.h')
AssertionError: 'header/dir\\chrome_android_strings.h' != 
'header/dir/chrome_android_strings.h'

----------------------------------------------------------------------
Ran 265 tests in 1.852s

FAILED (failures=4, errors=13)

Original issue reported on code.google.com by joi@chromium.org on 25 Feb 2013 at 3:07

GoogleCodeExporter commented 9 years ago
Several of these were fixed in r116.

Apart from a failure in IncludeNodeUnittest which is tracked in issue 17, the 
remaining errors are:

======================================================================
FAIL: testLowresFallback 
(grit.gather.chrome_scaled_image_unittest.ChromeScaledImageUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 162, in testLowresFallback
    _RunBuildTest(*args, skip_rc=True)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 109, in _RunBuildTest
    build.RcBuilder().Run(options, [])
  File "S:\src\grit-i18n\grit\tool\build.py", line 149, in Run
    self.Process()
  File "S:\src\grit-i18n\grit\tool\build.py", line 268, in Process
    self.ProcessNode(self.res, output, outfile)
  File "S:\src\grit-i18n\grit\tool\build.py", line 204, in ProcessNode
    formatted = formatter(node, output_node.GetLanguage(), output_dir=base_dir)
  File "S:\src\grit-i18n\grit\format\data_pack.py", line 46, in Format
    id, value = node.GetDataPackPair(lang, UTF8)
  File "S:\src\grit-i18n\grit\node\structure.py", line 206, in GetDataPackPair
    return id, self.gatherer.GetData(lang, encoding)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 136, in GetData
    data = _MoveSpecialChunksToFront(data)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 53, in _MoveSpecialChunksToFront
    for chunk in _ChunkifyPNG(data):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 67, in _ChunkifyPNG
    assert data.startswith(_PNG_MAGIC)
AssertionError

======================================================================
FAIL: testNormalFallback 
(grit.gather.chrome_scaled_image_unittest.ChromeScaledImageUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 134, in testNormalFallback
    'tactile_123_percent': set([t123a, d123b]),
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image_unittest.py", line 109, in _RunBuildTest
    build.RcBuilder().Run(options, [])
  File "S:\src\grit-i18n\grit\tool\build.py", line 149, in Run
    self.Process()
  File "S:\src\grit-i18n\grit\tool\build.py", line 268, in Process
    self.ProcessNode(self.res, output, outfile)
  File "S:\src\grit-i18n\grit\tool\build.py", line 204, in ProcessNode
    formatted = formatter(node, output_node.GetLanguage(), output_dir=base_dir)
  File "S:\src\grit-i18n\grit\format\data_pack.py", line 46, in Format
    id, value = node.GetDataPackPair(lang, UTF8)
  File "S:\src\grit-i18n\grit\node\structure.py", line 206, in GetDataPackPair
    return id, self.gatherer.GetData(lang, encoding)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 136, in GetData
    data = _MoveSpecialChunksToFront(data)
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 53, in _MoveSpecialChunksToFront
    for chunk in _ChunkifyPNG(data):
  File "S:\src\grit-i18n\grit\gather\chrome_scaled_image.py", line 67, in _ChunkifyPNG
    assert data.startswith(_PNG_MAGIC)
AssertionError

Original comment by joi@chromium.org on 28 Jun 2013 at 10:37

GoogleCodeExporter commented 9 years ago
Actually, those last two are tracked in issue 15. Closing the current bug.

Original comment by joi@chromium.org on 28 Jun 2013 at 10:50