Exemplo n.º 1
0
    def test_return_false(self):
        input_mock = MagicMock(return_value='anything else')
        input_args = MagicMock(**{
            'long_ids': False
        })

        with patch('builtins.input', input_mock):
            self.assertFalse(conduct_deploy.request_deploy_confirmation(self.resolved_version, input_args))

        input_mock.assert_called_with('Deploy cassandra:v1-d073991-a53237c? [Y/n]: ')
Exemplo n.º 2
0
    def test_return_false(self):
        input_mock = MagicMock(return_value='anything else')
        input_args = MagicMock(**{
            'long_ids': False
        })

        with patch('builtins.input', input_mock):
            self.assertFalse(conduct_deploy.request_deploy_confirmation(self.resolved_version, input_args))

        input_mock.assert_called_with('Deploy cassandra:v1-d073991-a53237c? [Y/n]: ')
Exemplo n.º 3
0
    def test_return_true_if_empty_with_long_ids(self):
        input_mock = MagicMock(return_value='')
        input_args = MagicMock(**{
            'long_ids': True
        })

        with patch('builtins.input', input_mock):
            self.assertTrue(conduct_deploy.request_deploy_confirmation(self.resolved_version, input_args))

        input_mock.assert_called_with('Deploy cassandra:v1-d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de? [Y/n]: ')
Exemplo n.º 4
0
    def test_return_true_if_empty_with_long_ids(self):
        input_mock = MagicMock(return_value='')
        input_args = MagicMock(**{
            'long_ids': True
        })

        with patch('builtins.input', input_mock):
            self.assertTrue(conduct_deploy.request_deploy_confirmation(self.resolved_version, input_args))

        input_mock.assert_called_with('Deploy cassandra:v1-d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de? [Y/n]: ')