Jetpack/Testing: Difference between revisions

Jump to navigation Jump to search
Line 129: Line 129:
<code>cfx testcfx</code> tests the <code>cfx</code> tool itself. <code>cfx</code> is written in Python, and <code>testcfx</code> uses Python's <code>unittest</code> framework.
<code>cfx testcfx</code> tests the <code>cfx</code> tool itself. <code>cfx</code> is written in Python, and <code>testcfx</code> uses Python's <code>unittest</code> framework.


<code>cfx</code> test code is implemented by a collection of Python modules under "python-lib/cuddlefish/tests". Each module implement defines a subclass of the unittest module's [http://docs.python.org/library/unittest.html#unittest.TestCase TestCase] class, and implements one or more test functions, each of which begins with the string "test". For example, here's what the "test_rdf" module looks like:
<code>cfx</code> test code is implemented by a collection of Python modules under "python-lib/cuddlefish/tests". Each module defines a subclass of the unittest module's [http://docs.python.org/library/unittest.html#unittest.TestCase TestCase] class, and implements one or more test functions, each of which begins with the string "test". For example, here's what the "test_rdf" module looks like:


  (addon-sdk)~/mozilla/addon-sdk > cd python-lib/cuddlefish/tests
  (addon-sdk)~/mozilla/addon-sdk > cd python-lib/cuddlefish/tests
canmove, Confirmed users
737

edits

Navigation menu