Mercurial > hgrepos > Python > apps > py-cutils
changeset 103:af8318191ed3
Some more tests
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Fri, 29 Apr 2022 10:31:18 +0200 |
| parents | 83dd2506f8f8 |
| children | 08fd0609fdd4 |
| files | tests/test_shasum.py |
| diffstat | 1 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test_shasum.py Fri Apr 29 10:19:27 2022 +0200 +++ b/tests/test_shasum.py Fri Apr 29 10:31:18 2022 +0200 @@ -59,6 +59,29 @@ destfile.getvalue().startswith( "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 *")) + def test_empty_with_name(self): + destfile = _memfile() + with ChangedDir(DATADIR): + opts = shasum.gen_opts(algorithm="SHA256", + dest=destfile, + files=["empty"]) + shasum.shasum(opts) + self.assertEqual( + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 *empty\n", + destfile.getvalue()) + + def test_empty_with_name_bsd(self): + destfile = _memfile() + with ChangedDir(DATADIR): + opts = shasum.gen_opts(algorithm="SHA512", + dest=destfile, + files=["empty"], + bsd=True) + shasum.shasum(opts) + self.assertEqual( + "SHA512 (empty) = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e\n", + destfile.getvalue()) + def test_empty_mmap(self): destfile = _memfile() opts = shasum.gen_opts(algorithm="SHA256",
