当前位置: 首页>>代码示例>>Python>>正文


Python FileSystem.join方法代码示例

本文整理汇总了Python中lettuce.fs.FileSystem.join方法的典型用法代码示例。如果您正苦于以下问题:Python FileSystem.join方法的具体用法?Python FileSystem.join怎么用?Python FileSystem.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lettuce.fs.FileSystem的用法示例。


在下文中一共展示了FileSystem.join方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_django_admin_media_serving_forced_by_setting

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
def test_django_admin_media_serving_forced_by_setting():
    'settings.LETTUCE_SERVE_ADMIN_MEDIA forces lettuce to serve admin assets'

    os.environ['PYTHONPATH'] = "%s:%s" % (
        FileSystem.join(lib_directory, 'Django-1.3'),
        OLD_PYTHONPATH,
    )

    FileSystem.pushd(current_directory, "django", "grocery")

    extra_args = " --scenarios=1,3,4,5 --settings=settings_without_admin"

    status, out = commands.getstatusoutput(
        "python manage.py harvest --verbosity=2 ./features/ %s" % extra_args)

    assert_equals(status, 0, out)
    FileSystem.popd()

    lines = out.splitlines()

    assert u"Preparing to serve django's admin site static files " \
           "(as per settings.LETTUCE_SERVE_ADMIN_MEDIA=True)..." in lines
    assert u'Running on port 7000 ... OK' in lines
    assert u'Fetching static files ... OK' in lines
    assert u'Fetching CSS files: ... OK' in lines
    assert u'Fetching javascript files: ... OK' in lines
    assert u"Django's builtin server is running at 0.0.0.0:7000" in lines

    # the scenario 2 is not suppose to run
    assert u'Fetching admin media ... OK' not in lines
开发者ID:benoitbryon,项目名称:lettuce,代码行数:32,代码来源:test_grocery.py

示例2: test_django_admin_media_serving_on_django_125

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
def test_django_admin_media_serving_on_django_125():
    'lettuce should serve admin static files properly on Django 1.2.5'

    os.environ['PYTHONPATH'] = "%s:%s" % (
        FileSystem.join(lib_directory, 'Django-1.2.5'),
        OLD_PYTHONPATH,
    )
    FileSystem.pushd(current_directory, "django", "grocery")

    status, out = commands.getstatusoutput(
        "python manage.py harvest --verbosity=2 ./features/")

    assert_equals(status, 0, out)
    FileSystem.popd()

    lines = out.splitlines()
    f = '\n\n'
    f += '*' * 100
    f += '\n' + '\n'.join(lines)

    assert u"Preparing to serve django's admin site static files..." in lines, f
    assert u"Django's builtin server is running at 0.0.0.0:7000" in lines, f
    assert u'Running on port 7000 ... OK' in lines, f
    assert u'Fetching admin media ... OK' in lines, f
    assert u'Fetching static files ... OK' in lines, f
    assert u'Fetching CSS files: ... OK' in lines, f
    assert u'Fetching javascript files: ... OK' in lines, f
开发者ID:benoitbryon,项目名称:lettuce,代码行数:29,代码来源:test_grocery.py

示例3: test_django_admin_media_serving_on_django_13

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
def test_django_admin_media_serving_on_django_13():
    "lettuce should serve admin static files properly on Django 1.3"

    os.environ["PYTHONPATH"] = "%s:%s" % (FileSystem.join(lib_directory, "Django-1.3"), OLD_PYTHONPATH)

    status, out = commands.getstatusoutput("python manage.py harvest --verbosity=2 ./features/")

    assert_not_equals(status, 0)

    lines = out.splitlines()

    assert u"Preparing to serve django's admin site static files..." in lines
    assert u"Django's builtin server is running at 0.0.0.0:7000" in lines
开发者ID:JMassapina,项目名称:lettuce,代码行数:15,代码来源:test_chive.py

示例4: test_django_admin_media_serving_on_django_16

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
def test_django_admin_media_serving_on_django_16():
    'lettuce should serve admin static files properly on Django 1.6' \
    'backward compatibility with an existing test before the port' \
    'targeting django version 1.3'

    os.environ['PYTHONPATH'] = "%s:%s" % (
        FileSystem.join(lib_directory, 'Django-1.6.2'),
        OLD_PYTHONPATH,
    )

    status, out = subprocess.getstatusoutput(
        "%s manage.py harvest --verbosity=2 ./features/" % sys.executable)

    assert_not_equals(status, 0)

    lines = out.splitlines()

    assert "Preparing to serve django's admin site static files..." in lines
    assert "Django's builtin server is running at 0.0.0.0:7000" in lines
开发者ID:rpaloschi,项目名称:lettuce,代码行数:21,代码来源:test_chive.py

示例5: test_django_admin_media_serving_on_django_13_and_up

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
def test_django_admin_media_serving_on_django_13_and_up():
    'lettuce should serve admin static files properly on Django 1.3 and up'

    os.environ['PYTHONPATH'] = "%s:%s" % (
        FileSystem.join(lib_directory, 'Django-1.6.2'),
        OLD_PYTHONPATH,
    )

    status, out = subprocess.getstatusoutput(
        "%s manage.py harvest --verbosity=2 ./features/" % sys.executable)

    assert_equals(status, 0, out)

    lines = out.splitlines()

    assert "Preparing to serve django's admin site static files..." in lines
    assert 'Running on port 7000 ... OK' in lines
    assert 'Fetching admin media ... OK' in lines
    assert 'Fetching static files ... OK' in lines
    assert 'Fetching CSS files: ... OK' in lines
    assert 'Fetching javascript files: ... OK' in lines
    assert "Django's builtin server is running at 0.0.0.0:7000" in lines
开发者ID:rpaloschi,项目名称:lettuce,代码行数:24,代码来源:test_grocery.py

示例6: teardown

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import subprocess

from lettuce.fs import FileSystem
from tests.asserts import assert_not_equals

current_directory = FileSystem.dirname(__file__)
lib_directory = FileSystem.join(current_directory,  'lib')


OLD_PYTHONPATH = os.getenv('PYTHONPATH', ':'.join(sys.path))


def teardown():
    os.environ['PYTHONPATH'] = OLD_PYTHONPATH


@FileSystem.in_directory(current_directory, 'django', 'chive')
def test_django_admin_media_serving_on_django_13():
    'lettuce should serve admin static files properly on Django 1.3'

    os.environ['PYTHONPATH'] = "%s:%s" % (
        FileSystem.join(lib_directory, 'Django-1.3'),
开发者ID:adw0rd,项目名称:lettuce-py3,代码行数:33,代码来源:test_chive.py

示例7: test_join

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
def test_join():
    fs = FileSystem()
    p = fs.join(fs.abspath("."), "test")
    p2 = join(abspath("."), "test")

    assert p == p2, "Expected:\n%r\nGot:\n%r" % (p2, p)
开发者ID:Bunch,项目名称:lettuce,代码行数:8,代码来源:test_file_system.py

示例8: teardown

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import commands

from lettuce.fs import FileSystem
from tests.asserts import assert_not_equals

current_directory = FileSystem.dirname(__file__)
lib_directory = FileSystem.join(current_directory, "lib")


OLD_PYTHONPATH = os.getenv("PYTHONPATH", ":".join(sys.path))


def teardown():
    os.environ["PYTHONPATH"] = OLD_PYTHONPATH


@FileSystem.in_directory(current_directory, "django", "chive")
def test_django_admin_media_serving_on_django_13():
    "lettuce should serve admin static files properly on Django 1.3"

    os.environ["PYTHONPATH"] = "%s:%s" % (FileSystem.join(lib_directory, "Django-1.3"), OLD_PYTHONPATH)
开发者ID:JMassapina,项目名称:lettuce,代码行数:32,代码来源:test_chive.py

示例9: assert_xsd_valid

# 需要导入模块: from lettuce.fs import FileSystem [as 别名]
# 或者: from lettuce.fs.FileSystem import join [as 别名]
def assert_xsd_valid(filename, content):
    xmlschema = etree.XMLSchema(etree.parse(
        open(FileSystem.join(current_directory, 'xunit.xsd'))
    ))
    xmlschema.assertValid(etree.parse(StringIO(content)))
开发者ID:rpaloschi,项目名称:lettuce,代码行数:7,代码来源:test_xunit_output.py


注:本文中的lettuce.fs.FileSystem.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。