test_daklib_dakapt.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #! /usr/bin/env python3
  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. import os
  21. from base_test import DakTestCase
  22. import daklib.dakapt
  23. class TestDakHashes(DakTestCase):
  24. def testDakHashes(self):
  25. with open(os.devnull) as fh:
  26. hashes = daklib.dakapt.DakHashes(fh)
  27. self.assertEqual(hashes.md5, "d41d8cd98f00b204e9800998ecf8427e")
  28. self.assertEqual(hashes.sha1, "da39a3ee5e6b4b0d3255bfef95601890afd80709")
  29. self.assertEqual(hashes.sha256, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")