Esempio n. 1
0
    def test_update_not_exist(self, _list):
        repository = Mock()
        _list.return_value = []

        # test
        remote = Remote('123', repository)
        remote.delete = Mock()
        remote.add = Mock()
        remote.update()

        # validation
        _list.assert_called_once_with(repository)
        remote.add.assert_called_once_with()
        self.assertFalse(remote.delete.called)
Esempio n. 2
0
    def test_update_not_exist(self, _list):
        repository = Mock()
        _list.return_value = []

        # test
        remote = Remote('123', repository)
        remote.delete = Mock()
        remote.add = Mock()
        remote.update()

        # validation
        _list.assert_called_once_with(repository)
        remote.add.assert_called_once_with()
        self.assertFalse(remote.delete.called)
Esempio n. 3
0
    def test_update(self, _list):
        remote_id = '123'
        repository = Mock()
        _list.return_value = [remote_id]

        # test
        remote = Remote(remote_id, repository)
        remote.delete = Mock()
        remote.add = Mock()
        remote.update()

        # validation
        _list.assert_called_once_with(repository)
        remote.delete.assert_called_once_with()
        remote.add.assert_called_once_with()
Esempio n. 4
0
    def test_update(self, _list):
        remote_id = '123'
        repository = Mock()
        _list.return_value = [remote_id]

        # test
        remote = Remote(remote_id, repository)
        remote.delete = Mock()
        remote.add = Mock()
        remote.update()

        # validation
        _list.assert_called_once_with(repository)
        remote.delete.assert_called_once_with()
        remote.add.assert_called_once_with()