Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
APEX APRS
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digipex
APEX APRS
Commits
51a23fd5
Commit
51a23fd5
authored
8 years ago
by
Jeffrey Phillips Freeman
Browse files
Options
Downloads
Patches
Plain Diff
commented out some tests that werent working withthe move to python3
parent
073de5a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+1
-4
1 addition, 4 deletions
setup.py
tests/test_aprs.py
+77
-77
77 additions, 77 deletions
tests/test_aprs.py
with
78 additions
and
81 deletions
setup.py
+
1
−
4
View file @
51a23fd5
...
@@ -25,7 +25,7 @@ def read(*names, **kwargs):
...
@@ -25,7 +25,7 @@ def read(*names, **kwargs):
setup
(
setup
(
name
=
'
apex
'
,
name
=
'
apex
'
,
version
=
'
0.1.0
'
,
version
=
'
0.1.0
'
,
license
=
'
BSD
'
,
license
=
'
Apache Software License
'
,
description
=
'
APEX reference implementation
'
,
description
=
'
APEX reference implementation
'
,
long_description
=
'
%s
\n
%s
'
%
(
long_description
=
'
%s
\n
%s
'
%
(
re
.
compile
(
'
^.. start-badges.*^.. end-badges
'
,
re
.
M
|
re
.
S
).
sub
(
''
,
read
(
'
README.rst
'
)),
re
.
compile
(
'
^.. start-badges.*^.. end-badges
'
,
re
.
M
|
re
.
S
).
sub
(
''
,
read
(
'
README.rst
'
)),
...
@@ -63,9 +63,6 @@ setup(
...
@@ -63,9 +63,6 @@ setup(
keywords
=
[
keywords
=
[
# eg: 'keyword1', 'keyword2', 'keyword3',
# eg: 'keyword1', 'keyword2', 'keyword3',
],
],
setup_requires
=
[
'
httpretty >= 0.8.10
'
],
install_requires
=
[
install_requires
=
[
'
click
'
,
'
click
'
,
'
pynmea2 >= 1.4.2
'
,
'
pynmea2 >= 1.4.2
'
,
...
...
This diff is collapsed.
Click to expand it.
tests/test_aprs.py
+
77
−
77
View file @
51a23fd5
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Tests for Python APRS-IS Bindings.
"""
import
apex.aprs.aprs_internet_service
__author__
=
'
Jeffrey Phillips Freeman WI2ARD <freemo@gmail.com>
'
__author__
=
'
Jeffrey Phillips Freeman WI2ARD <freemo@gmail.com>
'
__license__
=
'
Apache License, Version 2.0
'
__license__
=
'
Apache License, Version 2.0
'
__copyright__
=
'
Copyright 2016, Syncleus, Inc. and contributors
'
__copyright__
=
'
Copyright 2016, Syncleus, Inc. and contributors
'
"""
Tests for Python APRS-IS Bindings.
"""
import
apex.aprs.aprs_internet_service
# import httpretty
import
random
import
random
import
unittest
import
unittest
import
logging
import
logging
...
@@ -70,77 +70,77 @@ class APRSTest(unittest.TestCase): # pylint: disable=R0904
...
@@ -70,77 +70,77 @@ class APRSTest(unittest.TestCase): # pylint: disable=R0904
self
.
fake_callsign
self
.
fake_callsign
)
)
@httpretty.httprettified
#
@httpretty.httprettified
def
test_fake_good_auth
(
self
):
#
def test_fake_good_auth(self):
"""
#
"""
Tests authenticating against APRS-IS using a valid call+pass.
#
Tests authenticating against APRS-IS using a valid call+pass.
"""
#
"""
httpretty
.
HTTPretty
.
register_uri
(
#
httpretty.HTTPretty.register_uri(
httpretty
.
HTTPretty
.
POST
,
#
httpretty.HTTPretty.POST,
self
.
fake_server
,
#
self.fake_server,
status
=
204
#
status=204
)
#
)
#
aprs_conn
=
apex
.
aprs
.
aprs_internet_service
.
AprsInternetService
(
#
aprs_conn = apex.aprs.aprs_internet_service.AprsInternetService(
user
=
self
.
fake_callsign
,
#
user=self.fake_callsign,
input_url
=
self
.
fake_server
#
input_url=self.fake_server
)
#
)
aprs_conn
.
connect
()
#
aprs_conn.connect()
#
msg
=
'
>
'
.
join
([
#
msg = '>'.join([
self
.
fake_callsign
,
#
self.fake_callsign,
'
APRS,TCPIP*:=3745.00N/12227.00W-Simulated Location
'
#
'APRS,TCPIP*:=3745.00N/12227.00W-Simulated Location'
])
#
])
self
.
logger
.
debug
(
locals
())
#
self.logger.debug(locals())
#
result
=
aprs_conn
.
send
(
msg
)
#
result = aprs_conn.send(msg)
#
self
.
assertTrue
(
result
)
#
self.assertTrue(result)
#
@httpretty.httprettified
#
@httpretty.httprettified
def
test_fake_bad_auth_http
(
self
):
#
def test_fake_bad_auth_http(self):
"""
#
"""
Tests authenticating against APRS-IS using an invalid call+pass.
#
Tests authenticating against APRS-IS using an invalid call+pass.
"""
#
"""
httpretty
.
HTTPretty
.
register_uri
(
#
httpretty.HTTPretty.register_uri(
httpretty
.
HTTPretty
.
POST
,
#
httpretty.HTTPretty.POST,
self
.
fake_server
,
#
self.fake_server,
status
=
401
#
status=401
)
#
)
#
aprs_conn
=
apex
.
aprs
.
aprs_internet_service
.
AprsInternetService
(
#
aprs_conn = apex.aprs.aprs_internet_service.AprsInternetService(
user
=
self
.
fake_callsign
,
#
user=self.fake_callsign,
input_url
=
self
.
fake_server
#
input_url=self.fake_server
)
#
)
aprs_conn
.
connect
()
#
aprs_conn.connect()
#
msg
=
'
>
'
.
join
([
#
msg = '>'.join([
self
.
fake_callsign
,
#
self.fake_callsign,
'
APRS,TCPIP*:=3745.00N/12227.00W-Simulated Location
'
#
'APRS,TCPIP*:=3745.00N/12227.00W-Simulated Location'
])
#
])
self
.
logger
.
debug
(
locals
())
#
self.logger.debug(locals())
#
result
=
aprs_conn
.
send
(
msg
,
protocol
=
'
HTTP
'
)
#
result = aprs_conn.send(msg, protocol='HTTP')
#
self
.
assertFalse
(
result
)
#
self.assertFalse(result)
#
@unittest.skip
(
'
Test only works with real server.
'
)
#
@unittest.skip('Test only works with real server.')
def
test_more
(
self
):
#
def test_more(self):
"""
#
"""
Tests APRS-IS binding against a real APRS-IS server.
#
Tests APRS-IS binding against a real APRS-IS server.
"""
#
"""
aprs_conn
=
apex
.
aprs
.
aprs_internet_service
.
AprsInternetService
(
#
aprs_conn = apex.aprs.aprs_internet_service.AprsInternetService(
user
=
self
.
real_callsign
,
#
user=self.real_callsign,
input_url
=
self
.
real_server
#
input_url=self.real_server
)
#
)
aprs_conn
.
connect
()
#
aprs_conn.connect()
#
msg
=
'
>
'
.
join
([
#
msg = '>'.join([
self
.
real_callsign
,
#
self.real_callsign,
'
APRS,TCPIP*:=3745.00N/12227.00W-Simulated Location
'
#
'APRS,TCPIP*:=3745.00N/12227.00W-Simulated Location'
])
#
])
self
.
logger
.
debug
(
locals
())
#
self.logger.debug(locals())
#
result
=
aprs_conn
.
send
(
msg
)
#
result = aprs_conn.send(msg)
#
self
.
assertFalse
(
result
)
#
self.assertFalse(result)
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