コード例 #1
0
ファイル: adder.py プロジェクト: terminiter/pythoscope
def possible_test_module_names(module):
    module_name = module_path_to_name(module.subpath)

    for name in ["test_%s", "%s_test", "%sTest", "tests_%s", "%s_tests", "%sTests"]:
        yield (name % module_name) + ".py"
    for name in ["test%s", "Test%s", "%sTest", "tests%s", "Tests%s", "%sTests"]:
        yield (name % module_name.capitalize()) + ".py"
コード例 #2
0
ファイル: adder.py プロジェクト: goulu/pythoscope
def possible_test_module_names(module):
    module_name = module_path_to_name(module.subpath)

    for name in ["test_%s", "%s_test", "%sTest", "tests_%s", "%s_tests", "%sTests"]:
        yield (name % module_name) + ".py"
    for name in ["test%s", "Test%s", "%sTest", "tests%s", "Tests%s", "%sTests"]:
        yield (name % module_name.capitalize()) + ".py"
コード例 #3
0
ファイル: logger.py プロジェクト: h4ck3rm1k3/pythoscope
def path2modname(path, default=""):
    """Take a path to a pythoscope module and return a module name in dot-style
    notation. Return default if path doesn't point to a pythoscope module.
    """
    match = re.search(r'.*pythoscope%s(.*)$' % re.escape(os.path.sep), path)
    if match:
        return module_path_to_name(match.group(1), newsep=".")
    else:
        return default
コード例 #4
0
ファイル: logger.py プロジェクト: terminiter/pythoscope
def path2modname(path, default=""):
    """Take a path to a pythoscope module and return a module name in dot-style
    notation. Return default if path doesn't point to a pythoscope module.
    """
    match = re.search(r'.*pythoscope%s(.*)$' % re.escape(os.path.sep), path)
    if match:
        return module_path_to_name(match.group(1), newsep=".")
    else:
        return default
コード例 #5
0
ファイル: adder.py プロジェクト: jmikedupont2/pythoscope
def module_path_to_test_path(module):
    """Convert a module locator to a proper test filename.
    """
    return "test_%s.py" % module_path_to_name(module)
コード例 #6
0
 def _get_locator(self):
     return module_path_to_name(self.subpath, newsep=".")
コード例 #7
0
ファイル: adder.py プロジェクト: goulu/pythoscope
def module_path_to_test_path(module):
    """Convert a module locator to a proper test filename.
    """
    return "test_%s.py" % module_path_to_name(module)
コード例 #8
0
ファイル: localizable.py プロジェクト: Br3nda/pythoscope
 def _get_locator(self):
     return module_path_to_name(self.subpath, newsep=".")