Skip to content

Commit 6b50a68

Browse files
authored
Merge pull request #170 from Hritik14/develop
Fix CI tests
2 parents bf767c2 + 68ae017 commit 6b50a68

2 files changed

Lines changed: 13 additions & 12 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: 12 additions & 11 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
"""
@@ -82,7 +83,7 @@ def test_json_output_option_selected_all_selected(self):
8283
result_file = self.get_temp_file('json')
8384

8485
runner = CliRunner()
85-
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file, '-a'])
86+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file, '-a'], terminal_width=TERMINAL_WIDTH)
8687

8788
assert result.exit_code == 0
8889

@@ -248,7 +249,7 @@ 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(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file])
252+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file], terminal_width=TERMINAL_WIDTH)
252253

253254
assert result.exit_code == 0
254255

@@ -350,7 +351,7 @@ def test_no_output_option_selected_all_selected(self):
350351
old_scan = self.get_test_loc('cli/scan_1_file_moved_old.json')
351352

352353
runner = CliRunner()
353-
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-a'])
354+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-a'], terminal_width=TERMINAL_WIDTH)
354355

355356
assert result.exit_code == 0
356357

@@ -392,7 +393,7 @@ def test_no_output_option_selected_all_not_selected(self):
392393
old_scan = self.get_test_loc('cli/scan_1_file_moved_old.json')
393394

394395
runner = CliRunner()
395-
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan])
396+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan], terminal_width=TERMINAL_WIDTH)
396397

397398
assert result.exit_code == 0
398399

@@ -434,7 +435,7 @@ def test_json_deltas_count_all_selected(self):
434435
result_file = self.get_temp_file('json')
435436

436437
runner = CliRunner()
437-
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file, '-a'])
438+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file, '-a'], terminal_width=TERMINAL_WIDTH)
438439

439440
json_result = json.load(open(result_file))
440441

@@ -447,15 +448,15 @@ def test_json_deltas_count_all_not_selected(self):
447448
result_file = self.get_temp_file('json')
448449

449450
runner = CliRunner()
450-
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file])
451+
result = runner.invoke(cli.cli, ['-n', new_scan, '-o', old_scan, '-j', result_file], terminal_width=TERMINAL_WIDTH)
451452

452453
json_result = json.load(open(result_file))
453454

454455
assert json_result.get('deltas_count') == 4
455456

456457
def test_help(self):
457458
runner = CliRunner()
458-
result = runner.invoke(cli.cli, ['--help'])
459+
result = runner.invoke(cli.cli, ['--help'], terminal_width=TERMINAL_WIDTH)
459460

460461
assert 'Usage: cli [OPTIONS]' in result.output
461462
assert 'Identify the changes that need to be made' in result.output
@@ -465,19 +466,19 @@ def test_help(self):
465466

466467
def test_version(self):
467468
runner = CliRunner()
468-
result = runner.invoke(cli.cli, ['--version'])
469+
result = runner.invoke(cli.cli, ['--version'], terminal_width=TERMINAL_WIDTH)
469470

470471
assert 'DeltaCode version' in result.output
471472

472473
def test_empty(self):
473474
runner = CliRunner()
474-
result = runner.invoke(cli.cli, [])
475+
result = runner.invoke(cli.cli, [], terminal_width=TERMINAL_WIDTH)
475476

476477
assert 'Usage: cli [OPTIONS]' in result.output
477478
assert "Error: Missing option '-n' / '--new'." in result.output
478479

479480
def test_incorrect_flag(self):
480481
runner = CliRunner()
481-
result = runner.invoke(cli.cli, ['-xyz'])
482+
result = runner.invoke(cli.cli, ['-xyz'], terminal_width=TERMINAL_WIDTH)
482483

483-
assert 'Error: no such option: -x' in result.output
484+
assert 'Error: No such option: -x' in result.output

0 commit comments

Comments
 (0)