Пример #1
0
def test_get_module_path():
    "freeze.get_module_path() Should return the file path of a module without importing it"

    # Given a module name
    module = 'sure'

    # When I get its module path
    path = freeze.get_module_path(module)

    # Then I see that the file matches the expectations
    path.should.equal('sure')
Пример #2
0
def test_get_module_path():
    "freeze.get_module_path() Should return the file path of a module without importing it"

    # Given a module name
    module = 'sure'

    # When I get its module path
    path = freeze.get_module_path(module)

    # Then I see that the file matches the expectations
    path.should.equal('sure')
Пример #3
0
def test_get_module_path2(sys, imp):
    "freeze.get_module_path() Should return the file path without the .py[cO] extension"

    sys.path = ['/u/l/p/site-packages']
    imp.find_module.return_value = ['', '/u/l/p/site-packages/mock.py']

    # Given a module name
    module = 'mock'

    # When I get its module path
    path = freeze.get_module_path(module)

    # Then I see that the file matches the expectations
    path.should.equal('mock')
Пример #4
0
def test_get_module_path(sys, imp):
    "freeze.get_module_path() Should return the file path of a module without importing it"

    sys.path = ['/u/l/p/site-packages']
    imp.find_module.return_value = ['', '/u/l/p/site-packages/sure']

    # Given a module name
    module = 'sure'

    # When I get its module path
    path = freeze.get_module_path(module)

    # Then I see that the file matches the expectations
    path.should.equal('sure')
Пример #5
0
def test_get_module_path2(sys, imp):
    "freeze.get_module_path() Should return the file path without the .py[cO] extension"

    sys.path = ['/u/l/p/site-packages']
    imp.find_module.return_value = ['', '/u/l/p/site-packages/mock.py']

    # Given a module name
    module = 'mock'

    # When I get its module path
    path = freeze.get_module_path(module)

    # Then I see that the file matches the expectations
    path.should.equal('mock')
Пример #6
0
def test_get_module_path(sys, imp):
    "freeze.get_module_path() Should return the file path of a module without importing it"

    sys.path = ['/u/l/p/site-packages']
    imp.find_module.return_value = ['', '/u/l/p/site-packages/sure']

    # Given a module name
    module = 'sure'

    # When I get its module path
    path = freeze.get_module_path(module)

    # Then I see that the file matches the expectations
    path.should.equal('sure')