Exemplo n.º 1
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(), [])
Exemplo n.º 2
0
    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])
Exemplo n.º 3
0
    def test_task_header_no_tags(self):
        task = Task({})
        task.tags = []

        self.command.task_header(task)

        self.assertEqual(self.prompt.get_write_tags(), [])
Exemplo n.º 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(), [])
Exemplo n.º 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(), [])
Exemplo n.º 6
0
    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])
Exemplo n.º 7
0
    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'))
Exemplo n.º 8
0
    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'))