~ubuntu-branches/ubuntu/quantal/mago/quantal

« back to all changes in this revision

Viewing changes to brasero/brasero_basics.py

  • Committer: Bazaar Package Importer
  • Author(s): Ara Pulido
  • Date: 2010-12-03 16:08:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101203160832-97pz2nxwmo54iwfk
Tags: 0.3-0ubuntu3
* Updated from trunk
 + Added new applications to our tests base
 + Fixes LP: #682845 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
import os
 
3
from time import time, gmtime, strftime
 
4
 
 
5
from mago.test_suite.brasero import BraseroTestSuite
 
6
 
 
7
class BraseroBasics(BraseroTestSuite):
 
8
 
 
9
    def burn_path_to_iso(self, path_to_burn=None, iso_tmp_path=None):
 
10
        #Make sure the iso file is not there and if it's remove it.
 
11
        self.check_iso_and_remove(iso_tmp_path)
 
12
 
 
13
        dir_path = os.path.join(self.get_test_dir(), path_to_burn)
 
14
        self.application.burn_path_to_iso(dir_path, iso_tmp_path)
 
15
        #small check to see if the iso was created on the specified directory.
 
16
        if not(os.path.exists(iso_tmp_path)):
 
17
            raise AssertionError, "ISO file was not created."
 
18
        self.check_iso_and_remove(iso_tmp_path)
 
19
 
 
20
    def check_iso_and_remove (self, path=None):
 
21
        if (os.path.exists(path)):
 
22
            try:
 
23
                os.remove(path)
 
24
            except OSError, error:
 
25
                raise AssertionError, ("could not remove %s, %s" % (path, error))
 
26
 
 
27
if __name__ == "__main__":
 
28
    brasero_test =  BraseroBasics()
 
29
    brasero_test.run()