Skip to content

Commit 5d4d0e5

Browse files
committed
add windows test
1 parent 29b6128 commit 5d4d0e5

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ max-line-length = 132
33
exclude = .git,__pycache__,.eggs/,doc/,docs/,build/,dist/,archive/
44
per-file-ignores =
55
__init__.py:F401
6+
modules.py:F401

mozloc/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
from .base import log_wifi_loc
2+
from .modules import get_cli, cli_config_check

mozloc/base.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
from time import sleep
22
from pathlib import Path
3-
import sys
4-
5-
if sys.platform == "win32":
6-
from .netsh import cli_config_check, get_cli
7-
elif sys.platform == "linux":
8-
from .netman import cli_config_check, get_cli
9-
else:
10-
raise ImportError(f"MozLoc doesn't yet know how to work with platform {sys.platform}")
3+
4+
from .modules import get_cli, cli_config_check
5+
116
HEADER = "time lat lon accuracy NumBSSIDs"
127

138

mozloc/modules.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import sys
2+
3+
if sys.platform == "win32":
4+
from .netsh import cli_config_check, get_cli
5+
elif sys.platform == "linux":
6+
from .netman import cli_config_check, get_cli
7+
else:
8+
raise ImportError(f"MozLoc doesn't yet know how to work with platform {sys.platform}")

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = mozilla-location-python
3-
version = 0.9.0
3+
version = 1.0.0
44
author = Michael Hirsch, Ph.D.
55
author_email = [email protected]
66
url = https://github.com/scivision/mozilla-location-wifi
@@ -14,6 +14,7 @@ classifiers =
1414
Intended Audience :: Information Technology
1515
Intended Audience :: System Administrators
1616
Operating System :: POSIX :: Linux
17+
Operating System :: Microsoft :: Windows
1718
Programming Language :: Python :: 3.6
1819
Programming Language :: Python :: 3.7
1920
Programming Language :: Python :: 3.8

tests/test_all.py renamed to tests/test_netman.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ def test_nm_loc():
88
mozloc = pytest.importorskip("mozloc")
99

1010
try:
11-
loc = mozloc.netman.get_cli()
11+
loc = mozloc.get_cli()
1212
except subprocess.CalledProcessError as e:
1313
pytest.skip(f"problem with NMCLI API--old NMCLI version? {e}")
1414

15+
if loc is None:
16+
pytest.skip("need at least 2 WiFi AP")
17+
1518
assert isinstance(loc, dict)
1619
assert isinstance(loc["t"], datetime.datetime)
1720

@@ -20,9 +23,9 @@ def test_nm_connection():
2023
mozloc = pytest.importorskip("mozloc")
2124

2225
try:
23-
mozloc.netman.cli_config_check()
26+
mozloc.cli_config_check()
2427
except subprocess.CalledProcessError as e:
25-
pytest.skip(f"problem with NMCLI WiFi API--do you have WiFi? {e}")
28+
pytest.skip(f"problem with CLI WiFi API--do you have WiFi? {e}")
2629

2730

2831
if __name__ == "__main__":

0 commit comments

Comments
 (0)