def test_hsize(self): """ Get the hex size of a file """ with tempfile.NamedTemporaryFile(delete=False) as ebl: contents = "Hello Beautiful World!\n" if sys.version_info > (2, 7): contents = bytearray("Hello Beautiful World!\n", 'utf-8') ebl.write(contents) ebl.close() self.assertEqual('0x17', ffs.hsize(ebl.name))
def test_hsize_nofile(self): """ Don't Error if the file doesn't exist """ filepath = 'shouldnt_exist.file' self.assertTrue(not os.path.exists(filepath)) self.assertEqual(None, ffs.hsize(filepath))