test_daklib_dakapt.py 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #! /usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # © 2020, 😸 <😸@43-1.org>
  5. #
  6. # License: GPL-2+
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. from base_test import DakTestCase
  21. import daklib.dakapt
  22. class TestDakHashes(DakTestCase):
  23. def testDakHashes(self):
  24. hashes = daklib.dakapt.DakHashes(open("/dev/null"))
  25. self.assertEqual(hashes.md5, "d41d8cd98f00b204e9800998ecf8427e")
  26. self.assertEqual(hashes.sha1, "da39a3ee5e6b4b0d3255bfef95601890afd80709")
  27. self.assertEqual(hashes.sha256, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")