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


Python fs.FileSystem类代码示例

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


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

示例1: test_failfast

def test_failfast():
    'passing --failfast to the harvest command will cause lettuce to stop in the first failure'

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

    status, output = commands.getstatusoutput("python manage.py harvest --verbosity=3 --failfast")

    the(output).should.contain("This one is present")
    the(output).should.contain("Celeries before all")
    the(output).should.contain("Celeries before harvest")
    the(output).should.contain("Celeries before feature 'Test the django app leaves'")
    the(output).should.contain("Celeries before scenario 'This one is present'")

    the(output).should.contain("Celeries before step 'Given I say foo bar'")
    the(output).should.contain("Celeries after step 'Given I say foo bar'")
    the(output).should.contain("Celeries before step 'Then it fails'")
    the(output).should.contain("Celeries after step 'Then it fails'")

    the(output).should.contain("Celeries after scenario 'This one is present'")
    the(output).should.contain("Celeries after feature 'Test the django app leaves'")
    the(output).should.contain("Celeries after harvest")
    the(output).should.contain("Celeries after all")

    the(output).should_not.contain("This one is never called")

    FileSystem.popd()
开发者ID:Bunch,项目名称:lettuce,代码行数:26,代码来源:test_celeries.py

示例2: test_django_admin_media_serving_on_django_125

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,代码行数:27,代码来源:test_grocery.py

示例3: test_django_admin_media_serving_forced_by_setting

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,代码行数:30,代码来源:test_grocery.py

示例4: test_non_recursive_locate

def test_non_recursive_locate():
    fs = FileSystem()
    files = fs.locate(path=abspath(join(dirname(__file__), "files_to_locate")), match="*.txt", recursive=False)

    assert files
    assert isinstance(files, list)
    assert len(files) == 1
    assert split(files[0])[-1] == "test.txt"
开发者ID:Bunch,项目名称:lettuce,代码行数:8,代码来源:test_file_system.py

示例5: test_server_threading

def test_server_threading():
    """
    Test django httpd threading
    """
    FileSystem.pushd(current_directory, "django", "coconut")
    status, out = commands.getstatusoutput(
        "python manage.py harvest --verbosity=1")
    
    assert_equals(status, 0, out)
开发者ID:DrManchas,项目名称:lettuce,代码行数:9,代码来源:test_server.py

示例6: test_no_server

def test_no_server():
    '"harvest" --no-server does not start the server'

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

    status, out = commands.getstatusoutput("python manage.py harvest --verbosity=3 --apps=foobar --no-server")

    assert_equals(status, 0, out)
    assert "Django's builtin server is running at" not in out
开发者ID:DominikGuzei,项目名称:lettuce,代码行数:9,代码来源:test_alfaces.py

示例7: test_django_agains_alfaces

def test_django_agains_alfaces():
    'running the "harvest" django command with verbosity 3'

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

    status, out = commands.getstatusoutput("python manage.py harvest --verbosity=3")
    assert_equals(status, 0)

    FileSystem.popd()
开发者ID:emanuell,项目名称:lettuce,代码行数:9,代码来源:test_alfaces.py

示例8: test_harvest_sets_environment_variabled_for_gae

def test_harvest_sets_environment_variabled_for_gae():
    'harvest sets environment variables SERVER_NAME and SERVER_PORT in order to work with google app engine'

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

    status, out = commands.getstatusoutput("python manage.py harvest leaves/features/appengine.feature")
    assert_equals(status, 0, out)

    FileSystem.popd()
开发者ID:DominikGuzei,项目名称:lettuce,代码行数:9,代码来源:test_brocolis.py

示例9: test_harvest_with_debug_mode_disabled

def test_harvest_with_debug_mode_disabled():
    'python manage.py harvest without turns settings.DEBUG=False'

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

    status, out = commands.getstatusoutput("python manage.py harvest leaves/features/disabled.feature")
    assert_equals(status, 0, out)

    FileSystem.popd()
开发者ID:DominikGuzei,项目名称:lettuce,代码行数:9,代码来源:test_brocolis.py

示例10: test_model_creation

def test_model_creation():
    'Models are created through Lettuce steps'

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

    status, out = commands.getstatusoutput(
            "python manage.py harvest -T leaves/features/create.feature")
    assert_equals(status, 0, out)

    FileSystem.popd()
开发者ID:Bunch,项目名称:lettuce,代码行数:10,代码来源:test_dill.py

示例11: test_django_agains_couves

def test_django_agains_couves():
    'it always call @after.all hooks, even after exceptions'

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

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

    assert "Couves before all" in out
    assert "Couves after all" in out
    FileSystem.popd()
开发者ID:DominikGuzei,项目名称:lettuce,代码行数:10,代码来源:test_couves.py

示例12: test_django_no_test_database_option

def test_django_no_test_database_option():
    'test whether no test database is used if not wanted'

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

    status, out = commands.getstatusoutput("python manage.py harvest --verbosity=2 --no-test-database ./features/")
    assert_equals(status, 0)
    FileSystem.popd()

    assert_equals(re.match(r".*Creating test database for alias '\w+'\.\.\..*",out), None)
开发者ID:rstrobl,项目名称:lettuce,代码行数:10,代码来源:test_grocery.py

示例13: test_django_against_cucumber_django_project

def test_django_against_cucumber_django_project():
    'testing all django hooks'

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

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

    assert "before harvest" in out
    assert "after harvest" in out
    FileSystem.popd()
开发者ID:cillian,项目名称:lettuce,代码行数:10,代码来源:test_cucumber.py

示例14: test_running_all_apps_but_lettuce_avoid_apps

def test_running_all_apps_but_lettuce_avoid_apps():
    'running the "harvest" will run all apps but those within LETTUCE_AVOID_APPS'

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

    status, out = commands.getstatusoutput("python manage.py harvest --settings=allbutfoobarsettings --verbosity=3")
    assert_equals(status, 0, out)

    assert "Test the django app FOO BAR" not in out
    assert "Test the django app DO NOTHING" in out
    FileSystem.popd()
开发者ID:DominikGuzei,项目名称:lettuce,代码行数:11,代码来源:test_alfaces.py

示例15: test_running_only_apps_within_lettuce_apps_setting

def test_running_only_apps_within_lettuce_apps_setting():
    'running the "harvest" will run only on configured apps if the setting LETTUCE_APPS is set'

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

    status, out = commands.getstatusoutput("python manage.py harvest --settings=onlyfoobarsettings --verbosity=3")
    assert_equals(status, 0, out)

    assert "Test the django app FOO BAR" in out
    assert "Test the django app DO NOTHING" not in out
    FileSystem.popd()
开发者ID:DominikGuzei,项目名称:lettuce,代码行数:11,代码来源:test_alfaces.py


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