view tests/unit.py @ 14:8a02f209992f

tests/unit.py
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 28 Sep 2013 07:13:01 -0700
parents fc91a93fcaee
children 77118f83b5b7
line wrap: on
line source

#!/usr/bin/env python

"""
unit tests
"""

import os
import sys
import unittest

from commitwatcher import FeedAgentDiff

# globals
here = os.path.dirname(os.path.abspath(__file__))

class CommitWatcherUnitTest(unittest.TestCase):

    # diff -> files mapping, from `lsdiff`
    diff_files = [('41701d2c0341.diff', ['mobile/android/components/HelperAppDialog.js']),
                  ('4e1a3919e741.diff', ["gfx/gl/GLContext.cpp",
                                         "gfx/gl/GLContext.h",
                                         "gfx/layers/Compositor.h",
                                         "gfx/layers/Layers.cpp",
                                         "gfx/layers/Layers.h",
                                         "gfx/layers/basic/BasicCompositor.cpp",
                                         "gfx/layers/basic/BasicCompositor.h",
                                         "gfx/layers/composite/LayerManagerComposite.cpp",
                                         "gfx/layers/composite/LayerManagerComposite.h",
                                         "gfx/layers/d3d11/CompositorD3D11.cpp",
                                         "gfx/layers/d3d11/CompositorD3D11.h",
                                         "gfx/layers/d3d9/CompositorD3D9.cpp",
                                         "gfx/layers/d3d9/CompositorD3D9.h",
                                         "gfx/layers/ipc/CompositorParent.cpp",
                                         "gfx/layers/ipc/CompositorParent.h",
                                         "gfx/layers/ipc/LayerTransactionParent.cpp",
                                         "gfx/layers/opengl/CompositorOGL.cpp",
                                         "gfx/layers/opengl/CompositorOGL.h",
                                         "gfx/thebes/gfx2DGlue.h",
                                         ])
                                        ]
    def test_patch(self):
        """test parsing the files from a patch"""

        diff = os.path.join(here, '41701d2c0341.diff')
        files = FeedAgentDiff.lsdiff(diff)

if __name__ == '__main__':
    unittest.main()