def test_get_file_extension(self): self.assertIsNone(utils.get_file_extension('test')) self.assertIsNone(utils.get_file_extension('/tmp/blabla')) self.assertIsNotNone(utils.get_file_extension('test.c')) self.assertIsNotNone(utils.get_file_extension('/tmp/blabla.py')) self.assertEqual(utils.get_file_extension('test.c'), 'c') self.assertEqual(utils.get_file_extension('/tmp/blabla.py'), 'py') self.assertEqual(utils.get_file_extension('test.C'), 'c')
def assert_license_file_format(args): """ Assert param given license file has the .lic extension. """ passes = True error_message = None file_ext = utils.get_file_extension(args.license_file) if file_ext != "lic": passes = False error_message = "Error : Only .lic license files format is valid" return passes, error_message
def assert_license_file_format(args): """ Assert param given license file has the .lic extension. """ passes = True error_message = None file_ext = utils.get_file_extension(args.license_file) if file_ext != 'lic': passes = False error_message = "Error : Only .lic license files format is valid" return passes, error_message