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)
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))
def test_statfiles_file_abs(self): statinfo = statfiles(__file__) self.assertIsInstance(statinfo, dict) self.assertTrue(__file__ in statinfo)
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)
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)