Mocks Package

App Module

class HPCStats.Tests.Mocks.App.MockApp(db, config, cluster)

Bases: object

ArchitectureImporter Module

class HPCStats.Tests.Mocks.ArchitectureImporter.MockArchitectureImporter(app, db, config, cluster_name)

Bases: HPCStats.Importer.Architectures.ArchitectureImporter.ArchitectureImporter

BusinessCodeImporter Module

class HPCStats.Tests.Mocks.BusinessCodeImporter.MockBusinessCodeImporter(app, db, config)

Bases: HPCStats.Importer.BusinessCodes.BusinessCodeImporter.BusinessCodeImporter

Conf Module

class HPCStats.Tests.Mocks.Conf.MockConf(conf, cluster)

Bases: object

check_cluster()
get(section, param)
options(section)
sections()

MockConfigParser Module

class HPCStats.Tests.Mocks.MockConfigParser.MockConfigParser
get(section, option)
getboolean(section, option)
getint(section, option)
options(section)
read(filename)
sections()

MockLdap Module

class HPCStats.Tests.Mocks.MockLdap.MockLdap

Bases: object

Class with static methods to mock all used functions in psycogp2 module

static initialize(url)
static set_option(opt1, opt2)

Mock of ldap.set_options()

class HPCStats.Tests.Mocks.MockLdap.MockLdapConn

Bases: object

search_s(req_dn, flag, req_search, attrs)
simple_bind(dn, passwd)
HPCStats.Tests.Mocks.MockLdap.fill_ldap_users(ldap_config, users, users_no_group=None)
HPCStats.Tests.Mocks.MockLdap.mock_ldap()

MockPg2 Module

class HPCStats.Tests.Mocks.MockPg2.MockPsycopg2

Bases: object

Class with static methods to mock all used functions in psycogp2 module

static connect(conn)

Mock of psycopg2.connect()

class HPCStats.Tests.Mocks.MockPg2.MockPsycopg2Connect

Bases: object

close()
commit()
cursor()
class HPCStats.Tests.Mocks.MockPg2.MockPsycopg2Cursor

Bases: object

execute(req, params=None)
fetchall()
fetchone()
rowcount
class HPCStats.Tests.Mocks.MockPg2.PgReq(req)

Bases: object

Class for easy manipulation of fake PostgreSQL requests use by following Mock Psycopg2 classes, for testing purpose only.

set_assoc(params, result)

Set an association params/result to the PgReq.

HPCStats.Tests.Mocks.MockPg2.init_reqs()
HPCStats.Tests.Mocks.MockPg2.mock_psycopg2()

MySQLdb Module

class HPCStats.Tests.Mocks.MySQLdb.MockMySQLdb

Bases: object

Class with static methods to mock all used functions in MySQLdb module

static connect(host, user, passwd, db, port)

Mock of MySQLdb.connect()

class HPCStats.Tests.Mocks.MySQLdb.MockMySQLdbConnect(host, user, passwd, db, port)

Bases: object

close()
cursor(stuff=None)
class HPCStats.Tests.Mocks.MySQLdb.MockMySQLdbCursor

Bases: object

close()
execute(req, params=None)
fetchall()
fetchone()
HPCStats.Tests.Mocks.MySQLdb.mock_mysqldb()

ProjectImporter Module

class HPCStats.Tests.Mocks.ProjectImporter.MockProjectImporter(app, db, config)

Bases: HPCStats.Importer.Projects.ProjectImporter.ProjectImporter

UserImporter Module

class HPCStats.Tests.Mocks.UserImporter.MockUserImporter(app, db, config, cluster)

Bases: HPCStats.Importer.Users.UserImporter.UserImporter

Utils Module