Example #1
0
 def test_statfiles_dir_in_result(self):
     '''Assumes that directory ./sample-documents/ exists here'''
     here = os.path.dirname(os.path.abspath(__file__))
     statinfo = statfiles(here, relative=here)
     self.assertIsInstance(statinfo, dict)
     adoc = 'sample-documents/asciidoc-complete.txt'
     self.assertTrue(adoc in statinfo)
Example #2
0
 def test_statfiles_dir_in_result(self):
     '''Assumes that directory ./sample-documents/ exists here'''
     here = os.path.dirname(os.path.abspath(__file__))
     statinfo = statfiles(here, relative=here)
     self.assertIsInstance(statinfo, dict)
     adoc = 'sample-documents/asciidoc-complete.txt'
     self.assertTrue(adoc in statinfo)
Example #3
0
 def test_statfiles_nonexistent_file(self):
     here = os.path.dirname(os.path.abspath(__file__))
     this = os.path.join(here, str(uuid.uuid4()))
     statinfo = statfiles(this)
     self.assertIsInstance(statinfo, dict)
     self.assertEqual(0, len(statinfo))
Example #4
0
 def test_statfiles_file_abs(self):
     statinfo = statfiles(__file__)
     self.assertIsInstance(statinfo, dict)
     self.assertTrue(__file__ in statinfo)
Example #5
0
 def test_statfiles_file_rel(self):
     here = os.path.dirname(os.path.abspath(__file__))
     statinfo = statfiles(__file__, relative=here)
     self.assertIsInstance(statinfo, dict)
     self.assertTrue(os.path.basename(__file__) in statinfo)
Example #6
0
 def test_statfiles_dir_abs(self):
     here = os.path.dirname(os.path.abspath(__file__))
     statinfo = statfiles(here)
     self.assertIsInstance(statinfo, dict)
     self.assertTrue(__file__ in statinfo)
Example #7
0
 def test_statfiles_nonexistent_file(self):
     here = os.path.dirname(os.path.abspath(__file__))
     this = os.path.join(here, str(uuid.uuid4()))
     statinfo = statfiles(this)
     self.assertIsInstance(statinfo, dict)
     self.assertEqual(0, len(statinfo))
Example #8
0
 def test_statfiles_file_abs(self):
     statinfo = statfiles(__file__)
     self.assertIsInstance(statinfo, dict)
     self.assertTrue(__file__ in statinfo)
Example #9
0
 def test_statfiles_file_rel(self):
     here = os.path.dirname(os.path.abspath(__file__))
     statinfo = statfiles(__file__, relative=here)
     self.assertIsInstance(statinfo, dict)
     self.assertTrue(os.path.basename(__file__) in statinfo)
Example #10
0
 def test_statfiles_dir_abs(self):
     here = os.path.dirname(os.path.abspath(__file__))
     statinfo = statfiles(here)
     self.assertIsInstance(statinfo, dict)
     self.assertTrue(__file__ in statinfo)