def test_continuous_integration__set_browser(monkeypatch): monkeypatch.setattr(sys, 'argv', ["test.py", "--browser", "firefox"]) CIRunner.run = MagicMock(name='run') continuous_integration() CIRunner.run.assert_called_once_with(browser='firefox')
def test_continuous_integration__browser_default(monkeypatch): monkeypatch.setattr(sys, 'argv', ["test.py"]) CIRunner.run = MagicMock(name='run') continuous_integration() CIRunner.run.assert_called_once_with(browser=None)
def test_continuous_integration__set_seed(monkeypatch, mockfs_with_config, mock_CI_run): monkeypatch.setattr(sys, 'argv', ["test.py", "--seed", "1234"]) monkeypatch.setattr(jasmine.entry_points, 'JasmineApp', FakeApp) continuous_integration() CIRunner.run.assert_called_once_with(seed="1234", show_logs=False, browser=None, app=FakeApp.app)
def test_continuous_integration__show_logs(monkeypatch, mockfs_with_config, mock_CI_run): monkeypatch.setattr(sys, 'argv', ["test.py", "--logs"]) continuous_integration() CIRunner.run.assert_called_once_with(logs=True, browser=None)
def test_continuous_integration__set_browser(monkeypatch, mockfs_with_config, mock_CI_run): monkeypatch.setattr(sys, 'argv', ["test.py", "--browser", "firefox"]) continuous_integration() CIRunner.run.assert_called_once_with(browser='firefox', logs=False)
def test_continuous_integration__browser_default(monkeypatch, mockfs_with_config, mock_CI_run): monkeypatch.setattr(sys, 'argv', ["test.py"]) continuous_integration() CIRunner.run.assert_called_once_with(browser=None, logs=False)
def test_continuous_integration__set_browser(monkeypatch, mockfs_with_config, mock_CI_run): monkeypatch.setattr(sys, 'argv', ["test.py", "--browser", "firefox"]) monkeypatch.setattr(jasmine.entry_points, 'JasmineApp', FakeApp) continuous_integration() CIRunner.run.assert_called_once_with(browser='firefox', show_logs=False, seed=None, app=FakeApp.app)
def test_continuous_integration__custom_config__from_argv( monkeypatch, mockfs_with_config_and_custom_config): monkeypatch.setattr(sys, 'argv', ["test.py", "-c", "/custom/path/to/jasmine.yml"]) fake_standalone = Mock() monkeypatch.setattr(jasmine.entry_points, 'JasmineApp', fake_standalone) continuous_integration() fake_standalone.assert_called_once() standalone_construction_kwargs = fake_standalone.call_args[1] called_with_config = standalone_construction_kwargs[ 'jasmine_config'].yaml_file assert called_with_config == "/custom/path/to/jasmine.yml"
def test_ci_config_check(mockfs, monkeypatch, mock_CI_run): monkeypatch.setattr(sys, 'argv', ['test.py']) continuous_integration() assert not CIRunner.run.called