|  | 
|  | 1 | +import unittest | 
|  | 2 | + | 
|  | 3 | + | 
|  | 4 | +# enhancement 1 | 
|  | 5 | +def get_file_and_destination(): | 
|  | 6 | + input_file = input("What is the file name?") | 
|  | 7 | + mp4_converter = ".mp4" | 
|  | 8 | + input_file = input_file + mp4_converter | 
|  | 9 | + | 
|  | 10 | + destination_file = input("Where you want to save it to?") | 
|  | 11 | + return input_file, destination_file | 
|  | 12 | + | 
|  | 13 | + | 
|  | 14 | +# enhancement 2 | 
|  | 15 | +def get_user_input(): | 
|  | 16 | + user_preference = input("Enter your frame preference in total: ") | 
|  | 17 | + if not user_preference.isnumeric(): | 
|  | 18 | + print("Please enter an integer!") | 
|  | 19 | + new_value = get_user_input() | 
|  | 20 | + user_preference = new_value | 
|  | 21 | + return user_preference | 
|  | 22 | + | 
|  | 23 | + | 
|  | 24 | +# test variables for enhancement 1 | 
|  | 25 | +first, second = get_file_and_destination() | 
|  | 26 | +# test variable for enhancement 2 | 
|  | 27 | +input_number = get_user_input() | 
|  | 28 | + | 
|  | 29 | + | 
|  | 30 | +class BasicTests(unittest.TestCase): | 
|  | 31 | + | 
|  | 32 | + def test_get_string(self): | 
|  | 33 | + file_name = "video.mp4" | 
|  | 34 | + self.assertEqual(first, file_name) | 
|  | 35 | + | 
|  | 36 | + def test_get_destination(self): | 
|  | 37 | + destination = "testing destination" | 
|  | 38 | + self.assertEqual(second, destination) | 
|  | 39 | + | 
|  | 40 | + def test_input_number(self): | 
|  | 41 | + output_expected = input_number.isnumeric() | 
|  | 42 | + self.assertTrue(output_expected) | 
|  | 43 | + | 
|  | 44 | + | 
|  | 45 | +if __name__ == "__main__": | 
|  | 46 | + unittest.main() | 
0 commit comments