mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 16:22:18 -04:00
* Switch to pytest
git grep -l unittest.main | xargs sed -i 's/unittest.main()/sys.exit(pytest.main([__file__]))/g'
git ls-files -m | xargs -I {} sh -c "echo 'import sys\nimport pytest' >> '{}'"
isort --float-to-top .
* add pytest dep
* use sys.argv
19 lines
515 B
Python
19 lines
515 B
Python
"""Tests for acme.util."""
|
|
import sys
|
|
import unittest
|
|
|
|
import pytest
|
|
|
|
|
|
class MapKeysTest(unittest.TestCase):
|
|
"""Tests for acme.util.map_keys."""
|
|
|
|
def test_it(self):
|
|
from acme.util import map_keys
|
|
self.assertEqual({'a': 'b', 'c': 'd'},
|
|
map_keys({'a': 'b', 'c': 'd'}, lambda key: key))
|
|
self.assertEqual({2: 2, 4: 4}, map_keys({1: 2, 3: 4}, lambda x: x + 1))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(pytest.main(sys.argv[1:] + [__file__])) # pragma: no cover
|