~sidnei/lazr-js/yui-3.0.0-redux

« back to all changes in this revision

Viewing changes to src-py/lazr/js/tests/test_js.py

  • Committer: Sidnei da Silva
  • Date: 2009-10-22 14:12:59 UTC
  • mfrom: (140.1.2 jstestdriver-support)
  • Revision ID: sidnei.da.silva@canonical.com-20091022141259-u0v5ahmqp5mrpv0k
- Merge from jstestdriver-support

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from lazr.testing.jstestdriver import JsTestDriverTestCase
6
6
 
7
7
 
 
8
def get_root_directory():
 
9
    """Get the top-level directory for this package."""
 
10
    path = __file__
 
11
    for i in xrange(5):
 
12
        # The top-level directory is 5 levels up from here.
 
13
        path = os.path.dirname(path)
 
14
    return path
 
15
 
 
16
 
8
17
class LazrWidgetsTest(JsTestDriverTestCase):
9
18
 
10
 
    p = os.path.dirname
11
 
    config_filename = os.path.join(p(p(p(p(p((__file__)))))), "widgets.conf")
 
19
    config_filename = os.path.join(get_root_directory(), "widgets.conf")
12
20
 
13
21
 
14
22
def test_suite():
 
23
    assert os.path.exists(LazrWidgetsTest.config_filename)
15
24
    suite = unittest.TestSuite()
16
25
    suite.addTests(unittest.makeSuite(LazrWidgetsTest))
17
26
    return suite