~nataliabidart/software-center/winged-migration

« back to all changes in this revision

Viewing changes to tests/test_debfileapplication.py

  • Committer: Natalia B. Bidart
  • Date: 2012-05-30 18:39:55 UTC
  • mto: This revision was merged to the branch mainline in revision 3030.
  • Revision ID: natalia.bidart@canonical.com-20120530183955-zbnjczayktmmg5tv
- Initial test cleanup:
  - Renamed test/ dir to tests/.
  - Isolated test code into tests/ directory, including moving all the
    get_test_window_foo from the gtk3 production modules to
    tests/gtk3/windows.py module.
  - Removed all the calls to Gtk.main() in gtk3 tests since that blocks the
    execution of the suite.
  - Pep8 and pyflakes fixes in the files already modified in this branch.
  - Minor bug fix in the softwarecenter/log.py module when trying to create a
    log dir with proper perms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
 
1
import os
3
2
import unittest
4
 
import logging
5
3
 
6
 
from testutils import setup_test_env
 
4
from tests.utils import (
 
5
    DATA_DIR,
 
6
    get_test_db,
 
7
    setup_test_env,
 
8
)
7
9
setup_test_env()
8
10
 
9
11
from softwarecenter.enums import PkgStates
10
12
from softwarecenter.db.debfile import DebFileApplication, DebFileOpenError
11
 
from softwarecenter.testutils import get_test_db
12
 
 
13
 
DEBFILE_PATH = './data/test_debs/gdebi-test9.deb'
 
13
 
 
14
DEBFILE_DIR = os.path.join(DATA_DIR, 'test_debs')
 
15
 
 
16
DEBFILE_PATH = os.path.join(DEBFILE_DIR, 'gdebi-test9.deb')
14
17
DEBFILE_NAME = 'gdebi-test9'
15
18
DEBFILE_DESCRIPTION = ' provides/conflicts against "nvidia-glx"'
16
19
DEBFILE_SUMMARY = 'testpackage for gdebi - provides/conflicts against real pkg'
17
20
DEBFILE_VERSION = '1.0'
18
21
DEBFILE_WARNING = 'Only install this file if you trust the origin.'
19
22
 
20
 
DEBFILE_PATH_NOTFOUND = './data/test_debs/notfound.deb'
21
 
DEBFILE_PATH_NOTADEB = './data/notadeb.txt'
22
 
DEBFILE_PATH_CORRUPT = './data/test_debs/corrupt.deb'
23
 
DEBFILE_NOT_INSTALLABLE = './data/test_debs/gdebi-test1.deb'
 
23
DEBFILE_PATH_NOTFOUND = os.path.join(DEBFILE_DIR, 'notfound.deb')
 
24
DEBFILE_PATH_NOTADEB = os.path.join(DATA_DIR, 'notadeb.txt')
 
25
DEBFILE_PATH_CORRUPT = os.path.join(DEBFILE_DIR, 'corrupt.deb')
 
26
DEBFILE_NOT_INSTALLABLE = os.path.join(DEBFILE_DIR, 'gdebi-test1.deb')
24
27
 
25
28
 
26
29
class TestDebFileApplication(unittest.TestCase):
97
100
 
98
101
 
99
102
if __name__ == "__main__":
100
 
    logging.basicConfig(level=logging.DEBUG)
101
103
    unittest.main()
102