-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Olivier Chédru
committed
May 4, 2018
1 parent
54dd901
commit 0c87619
Showing
3 changed files
with
36 additions
and
3 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
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 liccheck.command_line import parse_args, read_strategy, run | ||
|
||
|
||
def test_parse_arguments(): | ||
args = parse_args(['--sfile', 'my_strategy.ini']) | ||
assert args.strategy_ini_file == 'my_strategy.ini' | ||
assert args.requirement_txt_file == './requirements.txt' | ||
args = parse_args(['--sfile', 'my_strategy.ini', '--rfile', 'my_requirements.txt']) | ||
assert args.strategy_ini_file == 'my_strategy.ini' | ||
assert args.requirement_txt_file == 'my_requirements.txt' | ||
|
||
|
||
def test_read_strategy(): | ||
args = parse_args(['--sfile', '../license_strategy.ini']) | ||
strategy = read_strategy(args.strategy_ini_file) | ||
assert len(strategy.AUTHORIZED_LICENSES) > 0 | ||
assert len(strategy.AUTHORIZED_PACKAGES) > 0 | ||
assert len(strategy.UNAUTHORIZED_LICENSES) > 0 | ||
|
||
|
||
def test_run(): | ||
args = parse_args(['--sfile', '../license_strategy.ini', '--rfile', '../requirements.txt']) | ||
run(args) |