本文整理汇总了Python中dexy.wrapper.Wrapper.assert_dexy_dirs_exist方法的典型用法代码示例。如果您正苦于以下问题:Python Wrapper.assert_dexy_dirs_exist方法的具体用法?Python Wrapper.assert_dexy_dirs_exist怎么用?Python Wrapper.assert_dexy_dirs_exist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dexy.wrapper.Wrapper
的用法示例。
在下文中一共展示了Wrapper.assert_dexy_dirs_exist方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_assert_dexy_dirs
# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import assert_dexy_dirs_exist [as 别名]
def test_assert_dexy_dirs():
with tempdir():
wrapper = Wrapper()
try:
wrapper.assert_dexy_dirs_exist()
assert False
except UserFeedback:
assert True
示例2: test_deprecated_dot_dexy_file
# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import assert_dexy_dirs_exist [as 别名]
def test_deprecated_dot_dexy_file():
with tempdir():
with open(".dexy", 'w') as f:
f.write("{}")
wrapper = Wrapper()
try:
wrapper.assert_dexy_dirs_exist()
except UserFeedback as e:
assert "this format is no longer supported" in str(e)
示例3: test_move_cache_dir
# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import assert_dexy_dirs_exist [as 别名]
def test_move_cache_dir():
with capture_stdout() as stdout:
with tempdir():
os.mkdir(".cache")
with open(".cache/.dexy-generated", 'w') as f:
f.write("")
wrapper = Wrapper()
wrapper.assert_dexy_dirs_exist()
assert "Moving directory '.cache'" in stdout.getvalue()
assert not os.path.exists(".cache")
assert os.path.exists(".dexy")
示例4: test_old_cache_dir_with_settings
# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import assert_dexy_dirs_exist [as 别名]
def test_old_cache_dir_with_settings():
with capture_stdout() as stdout:
with tempdir():
os.mkdir(".cache")
with open(".cache/.dexy-generated", 'w') as f:
f.write("")
wrapper = Wrapper(artifacts_dir = ".cache")
wrapper.assert_dexy_dirs_exist()
assert os.path.exists(".cache")
assert not os.path.exists(".dexy")
assert "You may have a dexy.conf file" in stdout.getvalue()
示例5: test_cache_and_dexy_dirs_present
# 需要导入模块: from dexy.wrapper import Wrapper [as 别名]
# 或者: from dexy.wrapper.Wrapper import assert_dexy_dirs_exist [as 别名]
def test_cache_and_dexy_dirs_present():
with tempdir():
os.mkdir(".dexy")
os.mkdir(".cache")
with open(".dexy/.dexy-generated", 'w') as f:
f.write("")
with open(".cache/.dexy-generated", 'w') as f:
f.write("")
wrapper = Wrapper()
try:
wrapper.assert_dexy_dirs_exist()
except UserFeedback as e:
assert "Please remove '.cache'" in str(e)
os.remove(".cache/.dexy-generated")
wrapper.assert_dexy_dirs_exist()
# Cache still exists but dexy just ignores it.
assert os.path.exists(".cache")
# Dexy uses .dexy dir
assert os.path.exists(".dexy")