Esempio n. 1
0
    def test_download_lotw_list_and_check_types(self):

        data = get_eqsl_users()
        assert isinstance(data, list)
        for el in data:
            assert isinstance(el, unicode)
        assert len(data) > 1000
Esempio n. 2
0
    def test_download_lotw_list_and_check_types(self):

        data = get_eqsl_users()
        assert isinstance(data, list)
        for el in data:
            assert isinstance(el, unicode)
        assert len(data) > 1000
Esempio n. 3
0
    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'})

        exec(open(os.path.join("./fixtures/", "eqsl_data.py")).read())
        assert get_eqsl_users(url=httpserver.url) == eqsl_fixture
Esempio n. 4
0
    def test_check_content_with_mocked_http_server(self, httpserver):
        httpserver.serve_content(
            open(os.path.join(fix_dir, 'eqsl_data.html'), 'rb').read(),
            headers={'content-type': 'text/plain; charset=ISO-8859-1'})

        namespace = {}
        execfile(os.path.join(fix_dir, "eqsl_data.py"), namespace)
        assert get_eqsl_users(url=httpserver.url) == namespace['eqsl_fixture']
Esempio n. 5
0
    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'})

        exec(open(os.path.join("./fixtures/","eqsl_data.py")).read())
        assert get_eqsl_users(url=httpserver.url) == eqsl_fixture
Esempio n. 6
0
 def test_with_invalid_url(self):
     with pytest.raises(IOError):
         get_eqsl_users(url="http://www.eqsl.cc/QSLCard/DownloadedFiles/AGMemberlist_my_unit_test.txt")
Esempio n. 7
0
 def test_with_invalid_url(self):
     with pytest.raises(IOError):
         get_eqsl_users(
             url=
             "http://www.eqsl.cc/QSLCard/DownloadedFiles/AGMemberlist_my_unit_test.txt"
         )
Esempio n. 8
0
    def test_check_content_with_mocked_http_server(self, httpserver):
        httpserver.serve_content(open(os.path.join(fix_dir, 'eqsl_data.html'), 'rb').read(), headers={'content-type': 'text/plain; charset=ISO-8859-1'})

        namespace = {}
        execfile(os.path.join(fix_dir,"eqsl_data.py"), namespace)
        assert get_eqsl_users(url=httpserver.url) == namespace['eqsl_fixture']