Exemple #1
0
 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))
Exemple #2
0
 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))
Exemple #3
0
 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))
Exemple #4
0
 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))