Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pgp-mime-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
pgp-mime-lib
Commits
f8b45679
Commit
f8b45679
authored
6 years ago
by
sand
Browse files
Options
Downloads
Patches
Plain Diff
update tests
parent
22e89de0
No related branches found
No related tags found
1 merge request
!1
Py3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pgp_mime_lib/test/test_pgp_mime_lib.py
+9
-6
9 additions, 6 deletions
pgp_mime_lib/test/test_pgp_mime_lib.py
tox.ini
+27
-9
27 additions, 9 deletions
tox.ini
with
36 additions
and
15 deletions
pgp_mime_lib/test/test_pgp_mime_lib.py
+
9
−
6
View file @
f8b45679
...
@@ -3,7 +3,6 @@ import shutil
...
@@ -3,7 +3,6 @@ import shutil
import
tempfile
import
tempfile
import
unittest
import
unittest
import
smtplib
import
smtplib
import
gnupg
from
email.mime.image
import
MIMEImage
from
email.mime.image
import
MIMEImage
from
email.mime.multipart
import
MIMEMultipart
from
email.mime.multipart
import
MIMEMultipart
...
@@ -11,8 +10,13 @@ from email.mime.text import MIMEText
...
@@ -11,8 +10,13 @@ from email.mime.text import MIMEText
import
pgp_mime_lib
import
pgp_mime_lib
import
logging
logging
.
getLogger
(
'
gnupg
'
).
setLevel
(
logging
.
DEBUG
)
logging
.
basicConfig
()
fixtures_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
fixtures
'
)
fixtures_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
fixtures
'
)
secret_key_dir
=
os
.
path
.
join
(
fixtures_dir
,
"
gnupghome/private-keys-v1.d
"
)
class
TestBase
(
unittest
.
TestCase
):
class
TestBase
(
unittest
.
TestCase
):
...
@@ -22,16 +26,15 @@ class TestBase(unittest.TestCase):
...
@@ -22,16 +26,15 @@ class TestBase(unittest.TestCase):
# Load our test secret key.
# Load our test secret key.
self
.
public_keyring
=
os
.
path
.
join
(
self
.
public_keyring
=
os
.
path
.
join
(
fixtures_dir
,
'
secret/pubring.gpg
'
)
fixtures_dir
,
'
gnupghome/pubring.gpg
'
)
self
.
secret_keyring
=
os
.
path
.
join
(
self
.
secret_key_dir
=
secret_key_dir
fixtures_dir
,
'
secret/secring.gpg
'
)
self
.
secret_key
=
'
0x56A1E35992BCB5CF
'
self
.
secret_key
=
'
0x56A1E35992BCB5CF
'
def
tearDown
(
self
):
def
tearDown
(
self
):
shutil
.
rmtree
(
self
.
dir
)
shutil
.
rmtree
(
self
.
dir
)
def
_gpg
(
self
):
def
_gpg
(
self
):
return
pgp_mime_lib
.
GPG
(
self
.
secret_key
,
self
.
public_keyring
,
self
.
secret_key
ring
)
return
pgp_mime_lib
.
GPG
(
self
.
secret_key
,
self
.
public_keyring
,
self
.
secret_key
_dir
)
class
TestSign
(
TestBase
):
class
TestSign
(
TestBase
):
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
27
−
9
View file @
f8b45679
[tox]
[tox]
envlist
=
py27
envlist
=
py27
, py3, flake8
[testenv]
[testenv]
deps
=
deps
=
nose
pytest
coverage
pytest-cov
setenv
=
LANG
=
en_US.UTF-8
GNUPG
=
/usr/bin/gpg
commands
=
commands
=
/usr/bin/env
LANG
=
en_US.UTF-8
\
# run pytest with -x --pdb to drop into pdb at the first failure
nosetests -v
\
pytest
--cov
=
pgp_mime_lib --cov-report html:htmlcov --cov-report term {posargs}
--with-coverage --cover-package=pgp_mime_lib
\
--cover-erase --cover-html --cover-html-dir=htmlcov
\
[testenv:flake8]
[]
basepython
=
python3
deps
=
flake8
flake8-builtins
flake8-bugbear
skip_install
=
true
commands
=
flake8 pgp_mime_lib/ setup.py
[flake8]
exclude
=
.tox/*, .git/*, build/*, pgp_mime_lib/_compat.py
max-line-length
=
100
select
=
E,F,W,C90,B,B902,C
[pytest]
norecursedirs
=
.tox
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment