コード例 #1
0
ファイル: project.py プロジェクト: pipermerriam/populus
 def migration_files(self):
     return list(
         (
             os.path.relpath(migration_file_path)
             for migration_file_path in sorted(find_project_migrations(self.project_dir))
         )
     )
コード例 #2
0
def test_finding_project_migrations(project_dir, write_project_file):
    good_project_migrations = {"migrations/0001_initial.py", "migrations/0002_something.py", "migrations/0003_other.py"}

    bad_project_migrations = {"migrations/0003_.py", "migrations/0003_has-dash.py"}

    for file_path in good_project_migrations:
        write_project_file(file_path)

    for file_path in bad_project_migrations:
        write_project_file(file_path)

    found_migrations = find_project_migrations(project_dir)
    assert set(found_migrations) == good_project_migrations
コード例 #3
0
def test_finding_project_migrations(project_dir, write_project_file):
    good_project_migrations = {
        'migrations/0001_initial.py',
        'migrations/0002_something.py',
        'migrations/0003_other.py',
    }

    bad_project_migrations = {
        'migrations/0003_.py',
        'migrations/0003_has-dash.py',
    }

    for file_path in good_project_migrations:
        write_project_file(file_path)

    for file_path in bad_project_migrations:
        write_project_file(file_path)

    found_migrations = find_project_migrations(project_dir)
    assert set(found_migrations) == good_project_migrations
コード例 #4
0
 def migration_files(self):
     return list((
         os.path.relpath(migration_file_path)
         for migration_file_path
         in sorted(find_project_migrations(self.project_dir))
     ))