コード例 #1
0
ファイル: test_cudl.py プロジェクト: aweiteka/pulp
    def test_task_header_unrelated_tags(self):
        task = Task({})
        task.tags = ['foo', 'bar']

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [])
コード例 #2
0
ファイル: test_cudl.py プロジェクト: aweiteka/pulp
    def test_task_header_action_tag_only(self):
        task = Task({})
        task.tags = [tags.action_tag(tags.ACTION_UPDATE_DISTRIBUTOR)]

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [tags.ACTION_UPDATE_DISTRIBUTOR])
コード例 #3
0
ファイル: test_cudl.py プロジェクト: aweiteka/pulp
    def test_task_header_no_tags(self):
        task = Task({})
        task.tags = []

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [])
コード例 #4
0
    def test_task_header_unrelated_tags(self):
        task = Task({})
        task.tags = ['foo', 'bar']

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [])
コード例 #5
0
    def test_task_header_no_tags(self):
        task = Task({})
        task.tags = []

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [])
コード例 #6
0
ファイル: test_cudl.py プロジェクト: ipanova/pulp
    def test_task_header_action_tag_only(self):
        task = Task({})
        task.tags = [tags.action_tag(tags.ACTION_UPDATE_DISTRIBUTOR)]

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [tags.ACTION_UPDATE_DISTRIBUTOR])
コード例 #7
0
ファイル: test_cudl.py プロジェクト: aweiteka/pulp
    def test_task_header_with_dist_tags(self):
        task = Task({})
        task.tags = [
            tags.action_tag(tags.ACTION_UPDATE_DISTRIBUTOR),
            tags.resource_tag(tags.RESOURCE_REPOSITORY_DISTRIBUTOR_TYPE, 'some_distributor'),
        ]

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [tags.ACTION_UPDATE_DISTRIBUTOR])
        # the message in this case should end with the distributor type
        self.assertTrue(self.recorder.lines[0].strip().endswith('some_distributor'))
コード例 #8
0
ファイル: test_cudl.py プロジェクト: ipanova/pulp
    def test_task_header_with_dist_tags(self):
        task = Task({})
        task.tags = [
            tags.action_tag(tags.ACTION_UPDATE_DISTRIBUTOR),
            tags.resource_tag(tags.RESOURCE_REPOSITORY_DISTRIBUTOR_TYPE, 'some_distributor'),
        ]

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [tags.ACTION_UPDATE_DISTRIBUTOR])
        # the message in this case should end with the distributor type
        self.assertTrue(self.recorder.lines[0].strip().endswith('some_distributor'))