예제 #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)