本文整理汇总了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
示例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
示例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
示例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
示例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
示例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'),
示例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)
示例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)
示例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)))