mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2026-04-07 07:24:03 +00:00
python3 compatible
This commit is contained in:
parent
dd6784ae09
commit
023880ff34
29 changed files with 324 additions and 294 deletions
|
|
@ -1,17 +1,25 @@
|
|||
import os
|
||||
from past.builtins import execfile
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from pyhamtools.qsl import get_eqsl_users
|
||||
|
||||
if sys.version_info.major == 3:
|
||||
unicode = str
|
||||
|
||||
test_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
fix_dir = os.path.join(test_dir, 'fixtures')
|
||||
class Test_eqsl_methods:
|
||||
|
||||
def test_check_content_with_mocked_http_server(self, httpserver):
|
||||
httpserver.serve_content(open('./fixtures/eqsl_data.html').read(), headers={'content-type': 'text/plain; charset=ISO-8859-1'})
|
||||
httpserver.serve_content(open(os.path.join(fix_dir, 'eqsl_data.html'), 'rb').read(), headers={'content-type': 'text/plain; charset=ISO-8859-1'})
|
||||
|
||||
exec(open(os.path.join("./fixtures/","eqsl_data.py")).read())
|
||||
assert get_eqsl_users(url=httpserver.url) == eqsl_fixture
|
||||
namespace = {}
|
||||
execfile(os.path.join(fix_dir,"eqsl_data.py"), namespace)
|
||||
assert get_eqsl_users(url=httpserver.url) == namespace['eqsl_fixture']
|
||||
|
||||
def test_download_lotw_list_and_check_types(self):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue