コード例 #1
0
    def test_only_other_type(self, mock_find):
        bindings = [{'repo_id': 'repo1', 'distributor_id': 'some_other_type'}]
        mock_find.return_value = bindings

        result = releases.get_bound_repos('consumer1')

        mock_find.assert_called_once_with('consumer1')
        self.assertEqual(result, [])
コード例 #2
0
ファイル: test_releases.py プロジェクト: aeria/pulp_puppet
    def test_only_other_type(self, mock_find):
        bindings = [{'repo_id': 'repo1', 'distributor_id': 'some_other_type'}]
        mock_find.return_value = bindings

        result = releases.get_bound_repos('consumer1')

        mock_find.assert_called_once_with('consumer1')
        self.assertEqual(result, [])
コード例 #3
0
    def test_only_puppet(self, mock_find):
        bindings =[{
            'repo_id': 'repo1',
            'distributor_id' : constants.DISTRIBUTOR_TYPE_ID
        }]
        mock_find.return_value = bindings

        result = releases.get_bound_repos('consumer1')

        mock_find.assert_called_once_with('consumer1')
        self.assertEqual(result, ['repo1'])
コード例 #4
0
    def test_only_puppet(self, mock_find):
        bindings =[{
            'repo_id': 'repo1',
            'distributor_id' : constants.DISTRIBUTOR_TYPE_ID
        }]
        mock_find.return_value = bindings

        result = releases.get_bound_repos('consumer1')

        mock_find.assert_called_once_with('consumer1')
        self.assertEqual(result, ['repo1'])
コード例 #5
0
ファイル: test_releases.py プロジェクト: aeria/pulp_puppet
    def test_mixed_types(self, mock_find):
        bindings = [
            {'repo_id': 'repo1', 'distributor_id': constants.DISTRIBUTOR_TYPE_ID},
            {'repo_id': 'repo2', 'distributor_id': 'some_other_type'},
            {'repo_id': 'repo3', 'distributor_id': constants.DISTRIBUTOR_TYPE_ID},
        ]
        mock_find.return_value = bindings

        result = releases.get_bound_repos('consumer1')

        mock_find.assert_called_once_with('consumer1')
        self.assertEqual(result, ['repo1', 'repo3'])
コード例 #6
0
    def test_mixed_types(self, mock_find):
        bindings =[
            {
               'repo_id': 'repo1',
               'distributor_id' : constants.DISTRIBUTOR_TYPE_ID
            },
            {
                'repo_id': 'repo2',
                'distributor_id' :'some_other_type'
            },
            {
                'repo_id': 'repo3',
                'distributor_id' : constants.DISTRIBUTOR_TYPE_ID
            },
        ]
        mock_find.return_value = bindings

        result = releases.get_bound_repos('consumer1')

        mock_find.assert_called_once_with('consumer1')
        self.assertEqual(result, ['repo1', 'repo3'])