test Package — Camelot documentation

### Navigation

- index
- modules |
- Camelot documentation »

# test Package

## `test` Package

Camelot unittest framework

class `camelot.test.` `ApplicationViewsTest`(methodName='runTest')

  Bases: `camelot.test.ModelThreadTestCase`

  Test various application level views, like the main window, the sidepanel

  `get_application_admin`()

    Overwrite this method to make use of a custom application admin

  `test_main_window`()
  `test_navigation_pane`()
  `test_tool_bar`()

class `camelot.test.` `EntityViewsTest`(methodName='runTest')

  Bases: `camelot.test.ModelThreadTestCase`

  Test the views of all the Entity subclasses, subclass this class to test all views in your application. This is done by calling the create_table_view and create_new_view on a set of admin objects. To tell the test case which admin objects should be tested, overwrite the get_admins method

  class MyEntityViewsTest(EntityViewsTest):

  > def get_admins(self):
  >   from elixir import entities application_admin import MyApplicationAdmin self.app_admin = MyApplicationAdmin() return [self.app_admin.get_entity_admin(e) for e in entities if self.app_admin.get_entity_admin(e)]

  `get_admins`()

    Should return all admin for which a table and a form view should be displayed, by default, returns for all entities their default admin

  `get_application_admin`()

    Overwrite this method to make use of a custom application admin

  `setUp`()
  `test_new_view`()
  `test_select_view`()
  `test_table_view`()

class `camelot.test.` `ModelThreadTestCase`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  Base class for implementing test cases that need a running model_thread.

  `grab_widget`(widget, suffix=None, subdir=None)

    Save a widget as a png file : :param widget: the widget to take a screenshot of :param suffix: string to add to the default filename of the image :param subdir: subdirectory of images_path in which to put the image file, defaults to the name of the test class - the name of the png file is the name of the test case, without ‘test_‘ - it is stored in the directory with the same name as the class, without ‘test’

  `images_path` = ''
  `process`()

    Wait until all events are processed and the queues of the model thread are empty

  `setUp`()
  `tearDown`()

class `camelot.test.` `SchemaTest`(methodName='runTest')

  Bases: `camelot.test.ModelThreadTestCase`

  Test the database schema

  `test_schema_display`()

`camelot.test.` `get_application`()

  Get the singleton QApplication

## `http_proxy` Module

class `camelot.test.http_proxy.` `HTTPProxy`(parent=None)

  Bases: `PyQt4.QtCore.QObject`

  `addr`()
  `authorize_request`(request_data)
  `close_connection`()
  `debug` = True
  `log` = <open file '<stderr>', mode 'w' at 0x403910d0>
  `manage_request`()
  `password` = 'password'
  `port`()
  `process_request`()
  `send_request`()
  `stopServing`()
  `transfer_data`()
  `username` = 'username'

## `test_field_attributes` Module

test module for the ‘camelot/view/field_attributes.py’ module

class `camelot.test.test_field_attributes.` `FromStringTestCase`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `test_bool_from_string`()
  `test_date_from_string`()
  `test_datetime_from_string`()
  `test_float_from_string`()
  `test_int_from_string`()
  `test_time_from_string`()

## `test_proxy` Module

class `camelot.test.test_proxy.` `ProxyTestCase`(methodName='runTest')

  Bases: `unittest.case.TestCase`

  `setUp`()
  `tearDown`()
  `test_access_to_remote_succeeded`()
  `test_access_with_credentials`()
  `test_access_without_credentials`()
  `test_getting_proxy`()

`camelot.test.test_proxy.` `clear_win_http_settings`()

`camelot.test.test_proxy.` `setup_a_win32_http_system_proxy`(hostname, port)

### Navigation

- index
- modules |
- Camelot documentation »

Comments
blog comments powered by Disqus