Skip to content

Commit

Permalink
Merge pull request #96 from 3c2b2ff5/python3_first
Browse files Browse the repository at this point in the history
modifed StringIO imports and mox3 import
  • Loading branch information
jaqx0r authored Oct 31, 2019
2 parents a79e231 + 0f22b56 commit c657287
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ install:
- travis_retry sudo apt-get install -y libnss-db libcurl4-gnutls-dev libgnutls-dev python-ldap python-mox python-pycurl
- |-
if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then
travis_retry sudo apt-get install -y python3-mox3 python3-ldap
travis_retry sudo apt-get install -y python3-mox3 python3-ldap python3-bsddb3
fi
- pip install .
- travis_retry pip install -r requirements.txt
Expand Down
5 changes: 4 additions & 1 deletion nss_cache/app_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@

import logging
import os
from io import BytesIO as StringIO
import sys
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO

from nss_cache import app

Expand Down
2 changes: 1 addition & 1 deletion nss_cache/caches/caches_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import config
from nss_cache.caches import caches
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/caches/files_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import config
from nss_cache.maps import automount
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/caches/nssdb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import error

Expand Down
4 changes: 4 additions & 0 deletions nss_cache/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
import os
import shutil
from io import BytesIO as StringIO
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import tempfile
import time

Expand Down
7 changes: 5 additions & 2 deletions nss_cache/command_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@
import os
import pwd
import shutil
from io import BytesIO as StringIO
import sys
import tempfile
import time
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO

try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import command
from nss_cache import config
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/lock_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import lock

Expand Down
2 changes: 1 addition & 1 deletion nss_cache/nss_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import config
from nss_cache import error
Expand Down
5 changes: 4 additions & 1 deletion nss_cache/sources/consulsource_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

__author__ = 'hexedpackets@gmail.com (William Huba)'

from io import BytesIO as StringIO
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import unittest

from nss_cache.maps import group
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/sources/httpsource_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import error

Expand Down
2 changes: 1 addition & 1 deletion nss_cache/sources/ldapsource_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import error
from nss_cache.maps import automount
Expand Down
5 changes: 4 additions & 1 deletion nss_cache/sources/s3source_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

__author__ = 'alexey.pikin@gmail.com'

from io import BytesIO as StringIO
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import unittest

from nss_cache.maps import group
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/update/files_updater_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import config
from nss_cache import error
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/update/map_updater_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache.caches import caches
from nss_cache.caches import files
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/update/updater_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache import config
from nss_cache.update import updater
Expand Down
2 changes: 1 addition & 1 deletion nss_cache/util/curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
try:
from cStringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
from io import StringIO
import logging
import pycurl

Expand Down
2 changes: 1 addition & 1 deletion nss_cache/util/timestamps_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
try:
import mox
except ImportError:
import mox3
from mox3 import mox

from nss_cache.util import timestamps

Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ pytest
boto3==1.7.36
pycurl==7.43.0.2
python-ldap
python3-ldap
python3-mox3
python3-bsddb3
mox==0.5.3

0 comments on commit c657287

Please sign in to comment.