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)