Ejemplo n.º 1
0
 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, [])
Ejemplo n.º 2
0
 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, [])
Ejemplo n.º 3
0
    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))