Example #1
0
    def test_good_filesystem(self):
        os.mkdir('tmp_dir')
        current_dir = os.path.abspath('./tmp_dir')
        tmp_file1 = os.path.join(current_dir,"tmp_pathfile1")
        tmp_file2 = os.path.join(current_dir,"tmp_pathfile2")
        write_tmp_file(tmp_file1,"NoContent")
        write_tmp_file(tmp_file2,"NoContent")

        known_paths = [ os.path.join(current_dir,"tmp_pathfile1")
                        , os.path.join(current_dir,"tmp_pathfile2") ]

        gen_paths = misc.generate_file_list(os.path.abspath("./tmp_dir"))
        shutil.rmtree("./tmp_dir")
        self.assertTrue(known_paths,gen_paths)
Example #2
0
 def test_good_file(self):
     write_tmp_file("tmp_hashfile", "Scrabdoodle\n")
     md5 = hash.hash_file("tmp_hashfile")
     known_md5 = "0371d05a44bf116ac0c58f59bb3532fd"
     self.assertEqual(md5, known_md5)
     os.remove("tmp_hashfile")
Example #3
0
 def test_good_file(self):
     write_tmp_file("test_file","")
     self.assertTrue(cli.validate_path('test_file'))
     os.remove("test_file")