def testEmptyExtensionsList(self): ''' Test that a valid list is returned, although an empty extensions-list is provided ''' returned_type = fut.get_all_code_files('../', []) self.assertIsInstance(returned_type, list) self.assertEqual(returned_type, [])
def testEmptyDirectory(self): ''' Test that a valid list is returned, although an empty directory is provided ''' returned_type = fut.get_all_code_files('', ['.h']) self.assertIsInstance(returned_type, list) self.assertEqual(returned_type, [])
def testNoneListType(self): ''' Test that an empty list is returned, although an invalid type is provided, and a warning is thrown ''' with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simplefilter("always") returned_type = fut.get_all_code_files('../', None) self.assertIsInstance(returned_type, list) self.assertEqual(returned_type, []) self.assertEqual(len(w), 1) self.assertTrue('Returning empty list..' in str(w[-1].message))