def test_get_file(self): """Test file import""" print(sys._getframe().f_code.co_name) real_file = hf._get_file('VAL',self.file_path) fake_file = hf._get_file('VAL',self.fake_path) self.assertIsNotNone(real_file) self.assertIsNotNone(fake_file) assert os.path.isfile(real_file[1]) assert not os.path.isfile(fake_file[1])
def test_get_file_no_file(self): print(sys._getframe().f_code.co_name) with patch('permittivitycalc.helper_functions._prompt',return_value=self.file_path): nofile = hf._get_file(airline='VAL') self.assertIsNotNone(nofile)
def test_get_file_no_airline_custom(self,mock): print(sys._getframe().f_code.co_name) noline = hf._get_file(file_path=self.file_path) self.assertIsNotNone(noline)
def test_get_file_custom_airline(self,mock): """Test custom airline""" print(sys._getframe().f_code.co_name) custom_line = hf._get_file('custom',self.file_path) self.assertIsNotNone(custom_line)
def test_get_file_nofile_noline_custom(self,mock): print(sys._getframe().f_code.co_name) with patch('permittivitycalc.helper_functions._prompt',return_value=self.file_path): file = hf._get_file() self.assertIsNotNone(file)