Fixed bug in setup.py and remove test auth file in mysql test

BUG: https://bugs.launchpad.net/freezer/+bug/1402218

Change-Id: I561ae49c9f2065fe5d97e1dc12ed41626e195a7e
This commit is contained in:
Fausto Marzi 2014-12-13 15:17:10 +00:00
parent 9da839229f
commit 0f725a0083
2 changed files with 6 additions and 6 deletions

View File

@ -1,13 +1,12 @@
'''
Freezer Setup Python file.
'''
"""Freezer Setup Python file.
"""
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import freezer
import os
here = os.path.abspath(os.path.dirname(__file__))
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
@ -23,9 +22,11 @@ class PyTest(TestCommand):
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
import sys
errno = pytest.main(self.pytest_args)
sys.exit(errno)
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', '\n')
@ -53,7 +54,6 @@ setup(
keywords="OpenStack Swift backup restore mongodb mysql lvm snapshot",
packages=find_packages(),
platforms='Linux, *BSD, OSX',
#test_suite='freezer.test.test_freezer',
cmdclass={'test': PyTest},
scripts=['bin/freezerc'],
classifiers=[

View File

@ -66,11 +66,11 @@ class TestBackUP:
mysql_conf_fd.write('host=abcd\nuser=abcd\npassword=abcd\n')
assert backup_mode_mysql(
backup_opt, 123456789, test_meta) is None
#os.unlink(backup_opt.mysql_conf_file)
fakemysql2 = FakeMySQLdb2()
monkeypatch.setattr(MySQLdb, 'connect', fakemysql2.connect)
pytest.raises(Exception, backup_mode_mysql, backup_opt, 123456789, test_meta)
os.unlink(backup_opt.mysql_conf_file)
def test_backup_mode_fs(self, monkeypatch):