1
# -*- coding: utf-8 -*-
3
# Copyright (c) 2013, Alex Băluț <alexandru.balut@gmail.com>
5
# This program is free software; you can redistribute it and/or
6
# modify it under the terms of the GNU Lesser General Public
7
# License as published by the Free Software Foundation; either
8
# version 2.1 of the License, or (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# Lesser General Public License for more details.
15
# You should have received a copy of the GNU Lesser General Public
16
# License along with this program; if not, write to the
17
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18
# Boston, MA 02110-1301, USA.
21
from unittest import TestCase
23
from pitivi.utils.timeline import Selected, Selection, SELECT, SELECT_ADD, \
27
class TestSelected(TestCase):
29
def testBoolEvaluation(self):
31
self.assertFalse(selected)
33
selected.selected = True
34
self.assertTrue(selected)
36
selected.selected = False
37
self.assertFalse(selected)
40
class TestSelection(TestCase):
42
def testBoolEvaluation(self):
43
clip1 = mock.MagicMock()
44
selection = Selection()
45
self.assertFalse(selection)
46
selection.setSelection([clip1], SELECT)
47
self.assertTrue(selection)
48
selection.setSelection([clip1], SELECT_ADD)
49
self.assertTrue(selection)
50
selection.setSelection([clip1], UNSELECT)
51
self.assertFalse(selection)