1
# -*- coding: utf-8 -*-
6
# Copyright (c) 2014, Alex Băluț <alexandru.balut@gmail.com>
8
# This program is free software; you can redistribute it and/or
9
# modify it under the terms of the GNU Lesser General Public
10
# License as published by the Free Software Foundation; either
11
# version 2.1 of the License, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
# Lesser General Public License for more details.
18
# You should have received a copy of the GNU Lesser General Public
19
# License along with this program; if not, write to the
20
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21
# Boston, MA 02110-1301, USA.
23
from common import TestCase
25
from pitivi import check
28
class FakeDependency(check.Dependency):
31
def _try_importing_component(self):
32
return self.import_result
35
class TestDependency(TestCase):
37
def testBoolEvaluation(self):
38
dependency = FakeDependency(modulename="module1", version_required_string=None)
39
self.assertFalse(dependency)
40
self.assertFalse(dependency.satisfied)
43
self.assertFalse(dependency)
44
self.assertFalse(dependency.satisfied)
46
dependency.import_result = "something"
48
self.assertTrue(dependency)
49
self.assertTrue(dependency.satisfied)