def test_primary_container_created_with_rm(self, mock_container): data = yaml.load(''' test-task: type: task primary: test-instance ''') containers = {} task = Task('test-task', data['test-task']) task._container_data = containers task.primary args, kwargs = mock_container.call_args self.assertTrue(kwargs['remove'])
def test_other_container_created_without_rm(self, mock_container): data = yaml.load(''' test-task: type: task images: - test-instance ''') containers = {} task = Task('test-task', data['test-task']) task._container_data = containers task.containers args, kwargs = mock_container.call_args self.assertFalse(kwargs.get('remove'))