Beispiel #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')
Beispiel #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'])
Beispiel #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'])
Beispiel #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')
Beispiel #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)
Beispiel #6
0
 def test_set(self, local_state):
     set_project('foo')
     assert_called_once_with(local_state.__setitem__, 'project', 'foo')
Beispiel #7
0
 def test_set(self, global_state):
     set_region('foo')
     assert_called_once_with(global_state.__setitem__, 'region', 'foo')
Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #11
0
 def test_set(self, local_state):
     set_project('foo')
     assert_called_once_with(local_state.__setitem__, 'project', 'foo')
Beispiel #12
0
 def test_set(self, global_state):
     set_region('foo')
     assert_called_once_with(global_state.__setitem__, 'region', 'foo')