Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1668 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

TG2 quickstart app test

Reported by: mramm Owned by: percious
Priority: normal Milestone: 2.0
Component: TurboGears Version: trunk
Severity: normal Keywords:
Cc:

Description (last modified by khorn) (diff)

We need to create some tests that quickstart a new app, test the quickstarted app, and then add some models, and controllers and test that. This will assure that the tg2 quickstart template continues to work.

TG1 has occasionally had quickstarted app issues, because there were not automated tests for these. And even when we found the issues, we didn't add tests because there was no infrastructure to test that.

Attachments

tg2-qstest-patch.diff Download (5.6 KB) - added by khorn 11 years ago.
First attempt at a patch to add this - still needs some work

Change History

comment:1 Changed 11 years ago by khorn

  • Description modified (diff)

the following code will create a quickstarted project from within python code:

def quickstart_project(proj_name, pkg_name):
    dist = 'TurboGears2'
    group = 'paste.global_paster_command'
    name = 'quickstart'
    qscmd = pkg_resources.load_entry_point(dist, group, name)
    qs = qscmd('quickstart')
    args = [proj_name, '-p', pkg_name]
    qs.run(args)

quickstart_project('qstest', 'qstestpkg')

hey, it's a start...

comment:2 Changed 11 years ago by khorn

  • Owner changed from anonymous to khorn

comment:3 Changed 11 years ago by khorn

I now have some code that will quickstart a project, and run a request against it using webob Request/Response? objects.

Still needs some tailoring into an actual test framework, instead of a hacked up standalone script.

Changed 11 years ago by khorn

First attempt at a patch to add this - still needs some work

comment:4 Changed 11 years ago by khorn

I've attached a patch which adds a nose "test package" to the tests directory. For these tests to work you currently need to run nosetests from the "test_quickstart" directory.

Outstanding issues:

  • I still need to figure out the best way to make sure the tests create the temporary quickstart project in the right place
  • teardown_package function does not clean up the temp directory quite all the way
  • one of the tests fails :( (see #1691)

Comments and improvements welcome.

comment:5 Changed 11 years ago by mramm

  • Owner changed from khorn to percious

comment:6 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to fixed

There is a solitary quickstart project test in the tgtools package.

Note: See TracTickets for help on using tickets.