Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)
Load a spec from either a file path or a fully qualified name.

        def load_by_name(name):
    """
    Load a spec from either a file path or a fully qualified name.

    """

    if os.path.exists(name):
        load_from_path(name)
    else:
        __import__(name)
        


src/i/v/ivoire-0.2/ivoire/spec/unit/load_spec.py   ivoire(Download)
    with it("loads paths") as test:
        test.path_exists.return_value = True
        load.load_by_name("foo")
        test.load_from_path.assert_called_once_with("foo")
 
    with it("loads modules") as test:
        test.path_exists.return_value = False
        load.load_by_name("foo")

src/i/v/Ivoire-HEAD/ivoire/spec/unit/load_spec.py   Ivoire(Download)
    with it("loads paths") as test:
        test.path_exists.return_value = True
        load.load_by_name("foo")
        test.load_from_path.assert_called_once_with("foo")
 
    with it("loads modules") as test:
        test.path_exists.return_value = False
        load.load_by_name("foo")

src/i/v/ivoire-0.2/ivoire/run.py   ivoire(Download)
 
from ivoire import result
from ivoire.load import load_by_name
from ivoire.transform import ExampleLoader, transform_possible
import ivoire
    for spec in config.specs:
        try:
            load_by_name(spec)
        except Exception:
            ivoire.current_result.addError(

src/i/v/Ivoire-HEAD/ivoire/run.py   Ivoire(Download)
 
from ivoire import result
from ivoire.load import load_by_name
from ivoire.transform import ExampleLoader, transform_possible
import ivoire
    for spec in config.specs:
        try:
            load_by_name(spec)
        except Exception:
            ivoire.current_result.addError(