Fixture generator for fixture module
Project description
Supports only SQLAlchemy
Install
Using pip
pip install fixturegen
Or using easy_install
easy_install fixturegen
Usage
Basic
$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user
from fixture import DataSet
class UserData(DataSet):
class user_1:
id = 1
name = u'first'
class user_2:
id = 2
name = u'second'
class user_3:
id = 3
name = u'third'
Limiting
$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --limit=2
from fixture import DataSet
class UserData(DataSet):
class user_1:
id = 1
name = u'first'
class user_2:
id = 2
name = u'second'
Ordering
$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --order-by='id DESC'
from fixture import DataSet
class UserData(DataSet):
class user_3:
id = 3
name = u'third'
class user_2:
id = 2
name = u'second'
class user_1:
id = 1
name = u'first'
Filtering
$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --where='id > 1'
from fixture import DataSet
class UserData(DataSet):
class user_2:
id = 2
name = u'second'
Hide import statement
$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --limit=1 --without-import
class UserData(DataSet):
class user_1:
id = 1
name = u'first'
Custom fixture class name:
$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --fixture-class-name DummyData --limit=1
class Dummy(DataSet):
class user_1:
id = 1
name = u'first'
Custom row class naming:
$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --naming-row-columns=id,name --limit=1
class Dummy(DataSet):
class user_1_first:
id = 1
name = u'first'
Help
$ fixturegen-sqlalchemy --help
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fixturegen-0.8.tar.gz
(4.3 kB
view details)
File details
Details for the file fixturegen-0.8.tar.gz
.
File metadata
- Download URL: fixturegen-0.8.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e995c609011cbd62a5168b4f33777bb2438ef5e4e4b9b8842f0195dff0a22328 |
|
MD5 | cc8ad1155df44268ab9719be7a121502 |
|
BLAKE2b-256 | 39a1611fed03d0ce5e916390b6559d9f38cbcc6dc33d8e8f628620f8e8c2f870 |