Exemplo n.º 1
0
def test_activate_existing(get_current, set_current, get_commit):
    get_current.return_value = 'bbb'
    get_commit.return_value = 'aaa'
    with mock_history(initial=['aaa', 'bbb']) as releases:
        activate()
        assert releases == ['aaa', 'bbb', 'aaa']
    assert_called_once_with(set_current, 'aaa')
Exemplo n.º 2
0
    def test_set(self, check_output):
        state = LocalState()
        state.git_args = ['cmd']

        check_output.return_value = "bar"
        assert state['foo'] == 'bar'
        assert_called_once_with(check_output, ['cmd', 'gonzo.foo'])
Exemplo n.º 3
0
    def test_set(self, check_output):
        state = LocalState()
        state.git_args = ['cmd']

        check_output.return_value = "bar"
        assert state['foo'] == 'bar'
        assert_called_once_with(check_output, ['cmd', 'gonzo.foo'])
Exemplo n.º 4
0
def test_activate_existing(get_current, set_current, get_commit):
    get_current.return_value = 'bbb'
    get_commit.return_value = 'aaa'
    with mock_history(initial=['aaa', 'bbb']) as releases:
        activate()
        assert releases == ['aaa', 'bbb', 'aaa']
    assert_called_once_with(set_current, 'aaa')
Exemplo n.º 5
0
 def test_missing_home(self, os, imp):
     os.path.exists.return_value = False
     imp.find_module.return_value = Mock(), Mock(), Mock()
     get_config_module()
     assert_called_once_with(os.mkdir, ANY)
Exemplo n.º 6
0
 def test_set(self, local_state):
     set_project('foo')
     assert_called_once_with(local_state.__setitem__, 'project', 'foo')
Exemplo n.º 7
0
 def test_set(self, global_state):
     set_region('foo')
     assert_called_once_with(global_state.__setitem__, 'region', 'foo')
Exemplo n.º 8
0
def test_rollback(get_current, set_current):
    get_current.return_value = 'bbb'
    with mock_history(initial=['aaa', 'bbb']) as releases:
        rollback()
        assert releases == ['aaa']
    assert_called_once_with(set_current, 'aaa')
Exemplo n.º 9
0
 def test_missing_home(self, os, imp):
     os.path.exists.return_value = False
     imp.find_module.return_value = Mock(), Mock(), Mock()
     get_config_module()
     assert_called_once_with(os.mkdir, ANY)
Exemplo n.º 10
0
def test_rollback(get_current, set_current):
    get_current.return_value = 'bbb'
    with mock_history(initial=['aaa', 'bbb']) as releases:
        rollback()
        assert releases == ['aaa']
    assert_called_once_with(set_current, 'aaa')
Exemplo n.º 11
0
 def test_set(self, local_state):
     set_project('foo')
     assert_called_once_with(local_state.__setitem__, 'project', 'foo')
Exemplo n.º 12
0
 def test_set(self, global_state):
     set_region('foo')
     assert_called_once_with(global_state.__setitem__, 'region', 'foo')