Skip to content

Commit 92c3355

Browse files
authored
Merge branch 'develop' into VC_determine_delta
2 parents ee639bf + 6b50a68 commit 92c3355

2 files changed

Lines changed: 33 additions & 21 deletions

File tree

configure.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ call mkdir "%CFG_ROOT_DIR%tmp"
8989
call curl -o "%CFG_ROOT_DIR%tmp\virtualenv.pyz" https://bootstrap.pypa.io/virtualenv.pyz
9090
call %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%tmp\virtualenv.pyz" "%CFG_ROOT_DIR%tmp"
9191
call "%CFG_ROOT_DIR%tmp\Scripts\activate"
92-
call "%CFG_ROOT_DIR%tmp\Scripts\pip" install --upgrade pip virtualenv setuptools wheel
92+
call "%PYTHON_EXECUTABLE%" -m pip install --upgrade pip virtualenv setuptools wheel
9393
call "%CFG_ROOT_DIR%tmp\Scripts\pip" install -e .[testing]
9494

9595
@rem Return a proper return code on failure

tests/test_cli.py

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from deltacode import DeltaCode
4040
from deltacode import utils
4141

42+
TERMINAL_WIDTH = 1000
4243

4344
def load_csv(location):
4445
"""
@@ -83,9 +84,9 @@ def test_json_output_option_selected_all_selected(self):
8384
result_file = self.get_temp_file("json")
8485

8586
runner = CliRunner()
86-
result = runner.invoke(
87-
cli.cli, ["-n", new_scan, "-o", old_scan, "-j", result_file, "-a"]
88-
)
87+
88+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file, '-a'], terminal_width=TERMINAL_WIDTH)
89+
8990

9091
assert result.exit_code == 0
9192

@@ -248,9 +249,9 @@ def test_json_output_option_selected_all_not_selected(self):
248249
result_file = self.get_temp_file("json")
249250

250251
runner = CliRunner()
251-
result = runner.invoke(
252-
cli.cli, ["-n", new_scan, "-o", old_scan, "-j", result_file]
253-
)
252+
253+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file], terminal_width=TERMINAL_WIDTH)
254+
254255

255256
assert result.exit_code == 0
256257

@@ -351,7 +352,9 @@ def test_no_output_option_selected_all_selected(self):
351352
old_scan = self.get_test_loc("cli/scan_1_file_moved_old.json")
352353

353354
runner = CliRunner()
354-
result = runner.invoke(cli.cli, ["-n", new_scan, "-o", old_scan, "-a"])
355+
356+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-a'], terminal_width=TERMINAL_WIDTH)
357+
355358

356359
assert result.exit_code == 0
357360

@@ -397,7 +400,9 @@ def test_no_output_option_selected_all_not_selected(self):
397400
old_scan = self.get_test_loc("cli/scan_1_file_moved_old.json")
398401

399402
runner = CliRunner()
400-
result = runner.invoke(cli.cli, ["-n", new_scan, "-o", old_scan])
403+
404+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan], terminal_width=TERMINAL_WIDTH)
405+
401406

402407
assert result.exit_code == 0
403408

@@ -442,9 +447,9 @@ def test_json_deltas_count_all_selected(self):
442447
result_file = self.get_temp_file("json")
443448

444449
runner = CliRunner()
445-
result = runner.invoke(
446-
cli.cli, ["-n", new_scan, "-o", old_scan, "-j", result_file, "-a"]
447-
)
450+
451+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file, '-a'], terminal_width=TERMINAL_WIDTH)
452+
448453

449454
json_result = json.load(open(result_file))
450455

@@ -457,17 +462,18 @@ def test_json_deltas_count_all_not_selected(self):
457462
result_file = self.get_temp_file("json")
458463

459464
runner = CliRunner()
460-
result = runner.invoke(
461-
cli.cli, ["-n", new_scan, "-o", old_scan, "-j", result_file]
462-
)
465+
466+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file], terminal_width=TERMINAL_WIDTH)
463467

464468
json_result = json.load(open(result_file))
465469

466470
assert json_result.get("deltas_count") == 4
467471

468472
def test_help(self):
469473
runner = CliRunner()
470-
result = runner.invoke(cli.cli, ["--help"])
474+
475+
result = runner.invoke(cli.cli, ['--help'], terminal_width=TERMINAL_WIDTH)
476+
471477

472478
assert "Usage: cli [OPTIONS]" in result.output
473479
assert "Identify the changes that need to be made" in result.output
@@ -478,19 +484,25 @@ def test_help(self):
478484

479485
def test_version(self):
480486
runner = CliRunner()
481-
result = runner.invoke(cli.cli, ["--version"])
487+
488+
result = runner.invoke(cli.cli, ['--version'], terminal_width=TERMINAL_WIDTH)
489+
482490

483491
assert "DeltaCode version" in result.output
484492

485493
def test_empty(self):
486494
runner = CliRunner()
487-
result = runner.invoke(cli.cli, [])
488495

489-
assert "Usage: cli [OPTIONS]" in result.output
496+
result = runner.invoke(cli.cli, [], terminal_width=TERMINAL_WIDTH)
497+
498+
assert 'Usage: cli [OPTIONS]' in result.output
499+
490500
assert "Error: Missing option '-n' / '--new'." in result.output
491501

492502
def test_incorrect_flag(self):
493503
runner = CliRunner()
494-
result = runner.invoke(cli.cli, ["-xyz"])
495504

496-
assert "Error: No such option: -x" in result.output
505+
result = runner.invoke(cli.cli, ['-xyz'], terminal_width=TERMINAL_WIDTH)
506+
507+
assert 'Error: No such option: -x' in result.output
508+

0 commit comments

Comments
 (0)