~timo-jyrinki/ubuntu/trusty/pitivi/backport_utopic_fixes

« back to all changes in this revision

Viewing changes to tests/test_utils.py

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2014-03-29 15:22:50 UTC
  • mto: (3.1.23 experimental)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: package-import@ubuntu.com-20140329152250-flg9onx416bqf3e3
Tags: upstream-0.93
Import upstream version 0.93

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#       test_utils.py
5
5
#
6
6
# Copyright (c) 2009, Alessandro Decina <alessandro.decina@collabora.co.uk>
 
7
# Copyright (c) 2014, Mathieu Duponchelle <mduponchelle1@gmail.com>
7
8
#
8
9
# This program is free software; you can redistribute it and/or
9
10
# modify it under the terms of the GNU Lesser General Public
24
25
 
25
26
from gi.repository import Gst
26
27
from pitivi.utils.ui import beautify_length
 
28
from pitivi.check import *
27
29
 
28
30
second = Gst.SECOND
29
31
minute = second * 60
50
52
    def testBeautifyHoursAndMinutes(self):
51
53
        self.failUnlessEqual(beautify_length(hour + minute + second),
52
54
                "1 hour, 1 minute")
 
55
 
 
56
 
 
57
class TestDependencyChecks(TestCase):
 
58
    def testDependencies(self):
 
59
        gi_dep = GstDependency("Gst", "1.0.0")
 
60
        gi_dep.check()
 
61
        self.failUnless(gi_dep.satisfied)
 
62
 
 
63
        gi_dep = GstDependency("Gst", "9.9.9")
 
64
        gi_dep.check()
 
65
        self.failIf(gi_dep.satisfied)
 
66
 
 
67
        gi_dep = GstDependency("ThisShouldNotExist", None)
 
68
        gi_dep.check()
 
69
        self.failIf(gi_dep.satisfied)
 
70
 
 
71
        gi_dep = GtkOrClutterDependency("Gtk", "3.0.0")
 
72
        gi_dep.check()
 
73
        self.failUnless(gi_dep.satisfied)
 
74
 
 
75
        gi_dep = GtkOrClutterDependency("Gtk", "9.9.9")
 
76
        gi_dep.check()
 
77
        self.failIf(gi_dep.satisfied)
 
78
 
 
79
        cairo_dep = CairoDependency("1.0.0")
 
80
        cairo_dep.check()
 
81
        self.failUnless(cairo_dep.satisfied)
 
82
 
 
83
        cairo_dep = CairoDependency("9.9.9")
 
84
        cairo_dep.check()
 
85
        self.failIf(cairo_dep.satisfied)
 
86
 
 
87
        classic_dep = ClassicDependency("numpy", None)
 
88
        classic_dep.check()
 
89
        self.failUnless(classic_dep.satisfied)
 
90
 
 
91
        gst_plugin_dep = GstPluginDependency("gnonlin", "1.1.90")
 
92
        gst_plugin_dep.check()
 
93
        self.failUnless(gst_plugin_dep.satisfied)
 
94
 
 
95
        gst_plugin_dep = GstPluginDependency("gnonlin", "9.9.9")
 
96
        gst_plugin_dep.check()
 
97
        self.failIf(gst_plugin_dep.satisfied)