示例#1
0
def runtests(cov=None, **params):
    import pulsar
    from pulsar.utils.path import Path
    from pulsar.apps.test import TestSuite
    from pulsar.apps.test.plugins import bench, profile
    import pulsar.utils.settings.backend
    #
    path = Path(__file__)
    path.add2python('stdnet', 1, down=['python-stdnet'], must_exist=False)
    strip_dirs = [Path(pulsar.__file__).parent.parent, os.getcwd()]
    #
    suite = TestSuite(description='Pulsar Asynchronous test suite',
                      modules=('tests',
                               ('examples', 'tests'),
                               ('examples', 'test_*')),
                      plugins=(bench.BenchMark(),
                               profile.Profile()),
                      pidfile='test.pid',
                      **params).start()
    #
    if suite.cfg.coveralls:
        from pulsar.utils.cov import coveralls
        coveralls(strip_dirs=strip_dirs,
                  stream=suite.stream,
                  repo_token='CNw6W9flYDDXZYeStmR1FX9F4vo0MKnyX')
示例#2
0
def runtests(**params):
    import pulsar
    from pulsar.utils.path import Path
    from pulsar.apps.test import TestSuite
    from pulsar.apps.test.plugins import bench, profile
    import pulsar.utils.settings.backend
    #
    path = Path(__file__)
    path.add2python('stdnet', 1, down=['python-stdnet'], must_exist=False)
    #
    TestSuite(description='Pulsar Asynchronous test suite',
              modules=('tests',
                       ('examples', 'tests'),
                       ('examples', 'test_*')),
              plugins=(bench.BenchMark(),
                       profile.Profile()),
              pidfile='test.pid',
              **params).start()
示例#3
0
文件: runtests.py 项目: japaks/pulsar
def runtests(cov=None, **params):
    import pulsar
    from pulsar.utils.path import Path
    from pulsar.apps.test import TestSuite
    from pulsar.apps.test.plugins import bench, profile
    import pulsar.utils.settings.backend
    #
    path = Path(__file__)
    path.add2python('stdnet', 1, down=['python-stdnet'], must_exist=False)
    strip_dirs = [Path(pulsar.__file__).parent.parent, os.getcwd()]
    #
    suite = TestSuite(description='Pulsar Asynchronous test suite',
                      modules=('tests', ('examples', 'tests'), ('examples',
                                                                'test_*')),
                      plugins=(bench.BenchMark(), profile.Profile()),
                      pidfile='test.pid',
                      **params).start()
    #
    if suite.cfg.coveralls:
        from pulsar.utils.cov import coveralls
        coveralls(strip_dirs=strip_dirs,
                  stream=suite.stream,
                  repo_token='CNw6W9flYDDXZYeStmR1FX9F4vo0MKnyX')
示例#4
0
文件: path.py 项目: Danzeer/pulsar
 def testAdd2Python_failure(self):
     p = Path()
     self.assertRaises(ImportError, p.add2python, 'kaputttt')
     self.assertFalse(p.add2python('vdfvdavfdv', must_exist=False))
示例#5
0
文件: path.py 项目: Danzeer/pulsar
 def testAdd2Python(self):
     p = Path('/sdjc/scdskjcdnsd/dhjdhjdjksdjksdksd')
     module = p.add2python('pulsar')
     self.assertEqual(module.__name__, 'pulsar')
     self.assertRaises(ValueError, p.add2python, 'kaputttt')
示例#6
0
文件: devenv.py 项目: pombredanne/lux
import sys
import os
try:
    from pulsar.utils.path import Path
except ImportError:
    # pulsar not available, we are in dev
    path = os.path.join(os.path.dirname(os.getcwd()), 'pulsar')
    if os.path.isdir(path):
        sys.path.append(path)
    from pulsar.utils.path import Path

import lux
path = Path(__file__)
path.add2python('stdnet', up=1, down=['python-stdnet'])
示例#7
0
文件: path.py 项目: japaks/pulsar
 def testAdd2Python_failure(self):
     p = Path()
     self.assertRaises(ImportError, p.add2python, 'kaputttt')
     self.assertFalse(p.add2python('vdfvdavfdv', must_exist=False))
示例#8
0
文件: path.py 项目: japaks/pulsar
 def testAdd2Python(self):
     p = Path('/sdjc/scdskjcdnsd/dhjdhjdjksdjksdksd')
     module = p.add2python('pulsar')
     self.assertEqual(module.__name__, 'pulsar')
     self.assertRaises(ValueError, p.add2python, 'kaputttt')
示例#9
0
 def testAdd2Python(self):
     p = Path("/sdjc/scdskjcdnsd/dhjdhjdjksdjksdksd")
     module = p.add2python("pulsar")
     self.assertEqual(module.__name__, "pulsar")
     self.assertRaises(ValueError, p.add2python, "kaputttt")