Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mysqld-integration-test
mysqld-integration-test is a python module that creates a temporary mysqld instance to use for testing your application.
Readme
mysqld-integration-test is a python module that creates a temporary mysqld instance to use for testing your application. It is based on the testing.mysqld
module which has not been updated recently. You will need a working MySQL or MariaDB install. It does not have to be running, the binaries are needed.
To install use pip:
$ pip install mysqld-integration-test
Or clone the repo:
$ git clone https://github.com/jasondcamp/mysqld-integration-test.git
The following class arguments can be overridden by passing them in, these arguments will override the config file arguments.
Argument | Description | Default |
---|---|---|
username | Username for database | root |
password | Password for database | root |
host | Host to bind | 127.0.0.1 |
port | Port to bind | random |
mysql_install_db_binary | Location of mysql_install_db | Searches paths |
mysqld_binary | Location of mysqld | Searches paths |
timeout_start | Timeout to start MySQL | 30 seconds |
timeout_stop | Timeout to stop MySQL | 30 seconds |
log_level | Log level | INFO |
config_file | Configuration file | mysqld-integration-test.cfg |
Default settings can be overridden in a config file. The default name is mysqld-integration-test.cfg
in the local directory and can be overridden by passing in the config
option to the instance creation.
database:
host: '127.0.0.1'
port: '9999'
username: 'root'
password: 'test'
mysql_install_db_binary: '/usr/local/bin/mysql_install_db'
mysqld_binary: '/usr/sbin/mysqld'
general:
log_level: 'DEBUG'
timeout_start: 30
timeout_stop: 30
from mysqld_integration_test import Mysqld
Starts up the mysql server
mysqld = Mysqld()
instance = mysqld.run()
Stops the mysql server
mysqld.stop()
#!/usr/bin/env python3
from mysqld_integration_test import Mysqld
import mysql.connector
mysqld = Mysqld(config='/some/dir/mysqld-integration-test.cfg')
instance = mysqld.run()
# Make query to database
cnx = mysql.connector.connect(user=instance.username, password=instance.password,
host=instance.host, port=instance.port)
cursor = cnx.cursor()
cursor.execute(f"SHOW databases;")
for db in cursor:
print(db[0])
cursor.close()
cnx.close()
mysqld.stop()
FAQs
mysqld-integration-test is a python module that creates a temporary mysqld instance to use for testing your application.
We found that mysqld-integration-test demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.