文件操作 - ExampleWithAssertThat.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/doc/python3-hamcrest/examples/ExampleWithAssertThat.py
编辑文件内容
import sys sys.path.append('..') from hamcrest import * import unittest class ExampleWithAssertThat(unittest.TestCase): def testUsingAssertThat(self): assert_that('xx', is_('xx')) assert_that('yy', is_not('xx')) assert_that('i like cheese', contains_string('cheese')) def testCanAlsoSupplyDescriptiveReason(self): assert_that('xx', is_('xx'), 'description') def testCanAlsoAssertPlainBooleans(self): assert_that(True, 'This had better not fail') if __name__ == '__main__': unittest.main()
修改文件时间
将文件时间修改为当前时间的前一年
删除文件