示例#1
0
    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')
示例#2
0
    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')
示例#3
0
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
示例#4
0
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