コード例 #1
0
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')
コード例 #2
0
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)
コード例 #3
0
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)
コード例 #4
0
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)
コード例 #5
0
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)
コード例 #6
0
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')
コード例 #7
0
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)
コード例 #8
0
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)
コード例 #9
0
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)
コード例 #10
0
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"
コード例 #11
0
def test_ci_config_check(mockfs, monkeypatch, mock_CI_run):
    monkeypatch.setattr(sys, 'argv', ['test.py'])

    continuous_integration()
    assert not CIRunner.run.called
コード例 #12
0
def test_ci_config_check(mockfs, monkeypatch, mock_CI_run):
    monkeypatch.setattr(sys, 'argv', ['test.py'])

    continuous_integration()
    assert not CIRunner.run.called
コード例 #13
0
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)
コード例 #14
0
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)
コード例 #15
0
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)