示例#1
0
 def test_size_md5(self, dependency):
     timestamp = os.path.getmtime(dependency)
     size = os.path.getsize(dependency)
     md5 = md5sum(dependency)
     # incorrect size dont check md5
     assert check_modified(dependency, (timestamp+1, size+1, ''))
     # correct size check md5
     assert not check_modified(dependency, (timestamp+1, size, md5))
     assert check_modified(dependency, (timestamp+1, size, ''))
示例#2
0
 def test_size_md5(self, dependency1):
     timestamp = os.path.getmtime(dependency1)
     size = os.path.getsize(dependency1)
     md5 = get_file_md5(dependency1)
     dep_stat = os.stat(dependency1)
     # incorrect size dont check md5
     assert check_modified(dependency1, dep_stat, (timestamp+1, size+1, ''))
     # correct size check md5
     assert not check_modified(dependency1, dep_stat, (timestamp+1, size, md5))
     assert check_modified(dependency1, dep_stat, (timestamp+1, size, ''))
示例#3
0
 def test_size_md5(self, dependency1):
     timestamp = os.path.getmtime(dependency1)
     size = os.path.getsize(dependency1)
     md5 = get_file_md5(dependency1)
     dep_stat = os.stat(dependency1)
     # incorrect size dont check md5
     assert check_modified(dependency1, dep_stat,
                           (timestamp + 1, size + 1, ''))
     # correct size check md5
     assert not check_modified(dependency1, dep_stat,
                               (timestamp + 1, size, md5))
     assert check_modified(dependency1, dep_stat, (timestamp + 1, size, ''))
示例#4
0
 def test_timestamp(self, dependency1):
     timestamp = os.path.getmtime(dependency1)
     dep_stat = os.stat(dependency1)
     assert not check_modified(dependency1, dep_stat, (timestamp, 0, ''))
     assert check_modified(dependency1, dep_stat, (timestamp+1, 0, ''))
示例#5
0
 def test_None(self, dependency1):
     assert check_modified(dependency1, os.stat(dependency1),  None)
示例#6
0
 def test_timestamp(self, dependency):
     timestamp = os.path.getmtime(dependency)
     assert not check_modified(dependency, (timestamp, 0, ''))
     assert check_modified(dependency, (timestamp+1, 0, ''))
示例#7
0
 def test_None(self, dependency):
     assert check_modified(dependency, None)
示例#8
0
 def test_timestamp(self, dependency1):
     timestamp = os.path.getmtime(dependency1)
     dep_stat = os.stat(dependency1)
     assert not check_modified(dependency1, dep_stat, (timestamp, 0, ''))
     assert check_modified(dependency1, dep_stat, (timestamp + 1, 0, ''))
示例#9
0
 def test_None(self, dependency1):
     assert check_modified(dependency1, os.stat(dependency1), None)