forked from rockymeza/wifi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sudo args to terminal calls. modified : tests/test_parsing.py modified : tests/test_scan.py modified : tests/test_schemes.py removed : wifi/dummydata.py modified : wifi/scheme.py Pull request fix #1. modifié : tests/test_scan.py modifié : tests/test_schemes.py Pull request fix #2. modifié: tests/test_scan.py modifié: tests/test_schemes.py Pull request fix rockymeza#3. modifié: setup.py Add 'mock' to the requires. Pull request fix rockymeza#4. modifié: .travis.yml Demand for latest update of setuptools when installing. Pull request fix rockymeza#5. Improve code readability. Add Travis to my own repository. Restore file permissions. Pull request fixes rebase. Rebase of the pull request fixes in order to clear the code and to solve build issues.
- Loading branch information
Showing
7 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ def read(fname): | |
|
||
|
||
install_requires = [ | ||
'setuptools', | ||
'pbkdf2', | ||
'mock', | ||
] | ||
try: | ||
import argparse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from unittest import TestCase | ||
|
||
from wifi.scan import Cell | ||
from wifi import subprocess_compat as subprocess | ||
from mock import patch | ||
from test_parsing import IWLIST_SCAN_WEP, IWLIST_SCAN_WPA2 | ||
|
||
|
||
expected_output = '\n'.join([IWLIST_SCAN_WEP, IWLIST_SCAN_WPA2]) | ||
|
||
class ScanTest(TestCase): | ||
def test_all_calls_check_output_with_good_args(self): | ||
args = ['/sbin/iwlist', 'interface', 'scan'] | ||
kwargs = {'stderr':subprocess.STDOUT} | ||
with patch.object(subprocess, 'check_output', | ||
return_value=expected_output): | ||
#subprocess.check_output = MagicMock(return_value=expected_output) | ||
Cell.all('interface') | ||
subprocess.check_output.assert_called_with(args, **kwargs) | ||
args.insert(0, 'sudo') | ||
Cell.all('interface', sudo=True) | ||
subprocess.check_output.assert_called_with(args, **kwargs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters