Ejemplo n.º 1
0
 def test_collected_names(self):
     filenames = collect_files(DATA_DIR).keys()
     self.assertEqual(len(filenames), 2)
     self.assertIn("empty1.txt", filenames)
     self.assertIn("README.md", filenames)
     self.assertNotIn("should_be_ignored", filenames)
     self.assertNotIn("empty2.txt", filenames)
Ejemplo n.º 2
0
 def test_collected_names(self):
     filenames = collect_files(DATA_DIR).keys()
     self.assertEqual(len(filenames), 2)
     self.assertIn("empty1.txt", filenames)
     self.assertIn("README.md", filenames)
     self.assertNotIn("should_be_ignored", filenames)
     self.assertNotIn("empty2.txt", filenames)
Ejemplo n.º 3
0
 def test_collected_contents(self):
     files = collect_files(DATA_DIR)
     self.assertEqual("", files["empty1.txt"])
     self.assertEqual("This is a test harness for collect_files().\n",
                      files["README.md"])
Ejemplo n.º 4
0
 def test_collected_contents_are_correct(self):
     contents, _ = collect_files(DATA_DIR, filesize_limit=300)
     self.assertEqual(contents['empty1.txt'], '')
     self.assertEqual(contents['README.md'],
                      'This is a test harness for collect_files().\n')
Ejemplo n.º 5
0
 def test_subdirs_are_not_collected(self):
     contents, ignored_names = collect_files(DATA_DIR, filesize_limit=1000)
     self.assertEqual(
         contents.keys(),
         {'empty1.txt', 'README.md', 'larger_than_300_bytes.txt'})
     self.assertFalse(ignored_names)
Ejemplo n.º 6
0
 def test_collected_contents(self):
     files = collect_files(DATA_DIR)
     self.assertEqual("", files["empty1.txt"])
     self.assertEqual("This is a test harness for collect_files().\n", files["README.md"])