annotate tests/unit.py @ 13:fc91a93fcaee

tests/unit.py
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 28 Sep 2013 07:08:32 -0700
parents a0ff003319ec
children 8a02f209992f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 unit tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 import os
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 import sys
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 import unittest
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
11
546695da018c commitwatcher/agent.py tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
11 from commitwatcher import FeedAgentDiff
546695da018c commitwatcher/agent.py tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
12
0
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 # globals
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 here = os.path.dirname(os.path.abspath(__file__))
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15
11
546695da018c commitwatcher/agent.py tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
16 class CommitWatcherUnitTest(unittest.TestCase):
0
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17
13
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
18 # diff -> files mapping, from `lsdiff`
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
19 diff_files = [('41701d2c0341.diff': ['mobile/android/components/HelperAppDialog.js']),
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
20 ('4e1a3919e741.diff', ["gfx/gl/GLContext.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
21 "gfx/gl/GLContext.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
22 "gfx/layers/Compositor.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
23 "gfx/layers/Layers.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
24 "gfx/layers/Layers.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
25 "gfx/layers/basic/BasicCompositor.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
26 "gfx/layers/basic/BasicCompositor.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
27 "gfx/layers/composite/LayerManagerComposite.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
28 "gfx/layers/composite/LayerManagerComposite.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
29 "gfx/layers/d3d11/CompositorD3D11.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
30 "gfx/layers/d3d11/CompositorD3D11.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
31 "gfx/layers/d3d9/CompositorD3D9.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
32 "gfx/layers/d3d9/CompositorD3D9.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
33 "gfx/layers/ipc/CompositorParent.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
34 "gfx/layers/ipc/CompositorParent.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
35 "gfx/layers/ipc/LayerTransactionParent.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
36 "gfx/layers/opengl/CompositorOGL.cpp",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
37 "gfx/layers/opengl/CompositorOGL.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
38 "gfx/thebes/gfx2DGlue.h",
fc91a93fcaee tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
39 ]
11
546695da018c commitwatcher/agent.py tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
40 def test_patch(self):
546695da018c commitwatcher/agent.py tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
41 """test parsing the files from a patch"""
546695da018c commitwatcher/agent.py tests/unit.py
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
42
12
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
43 diff = os.path.join(here, '41701d2c0341.diff')
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
44 files = FeedAgentDiff.lsdiff(diff)
0
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
45
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
46 if __name__ == '__main__':
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
47 unittest.main()
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
48