def test_get_file_mtime_calc(self): file_name = 'text_file.txt' mtime_calc = Backup.get_file_mtime_calc(file_name) mtime_read = Backup.get_file_atts_read(file_name)[1] print(Backup.get_file_xatts(file_name)) print(mtime_calc, mtime_read) self.assertEqual(mtime_calc, mtime_read)
def test_get_file_atts_read(self): test_file = 'text_file.txt' file_attributes_calc = Backup.get_file_atts_calc(test_file) file_attributes_read = Backup.get_file_atts_read(test_file)[0:2] Backup.check_sum_validity(file_attributes_calc[0]) Backup.check_time_validity(file_attributes_calc[1]) #cmd = ['rsync', '-a', 'opalinsp@localhost:/home/opalinsp/mac.jpg', '.'] #p = subprocess.Popen(cmd, # stdout=subprocess.PIPE, # stderr=subprocess.PIPE) #out, err = p.communicate() #print(out, err) self.assertEqual(file_attributes_calc, file_attributes_read)
def test_get_file_atts_calc(self): test_file = 'text_file.txt' file_attributes_calc = Backup.get_file_atts_calc(test_file) file_attributes_read = Backup.get_file_atts_read(test_file)[0:2] self.assertEqual(file_attributes_calc, file_attributes_read)