exview tests

ExTests for extools.view.ExView.

class extools.view.tests.extest_exview.ExViewAttributesTestCase(log_level=15)[source]

Bases: extools.test.ExTestCase

Verify extools.view.ExView passes attrs to the view.

setup()[source]

Clear the class internals before each test.

setup_class()[source]

Generate the attribute proxy tests.

class extools.view.tests.extest_exview.ExViewCMTestCase(log_level=15)[source]

Bases: extools.test.ExTestCase

Test the extools.view.exview context manager.

test_exview_contextmanager()[source]

Verify that the extools.view.exview() context manager is working:

  • Opens and seeks to the first record by default.
  • Opens and seeks to the provided criteria.
  • Raises on an invalid view id.
class extools.view.tests.extest_exview.ExViewExceptionsTestCase(log_level=15)[source]

Bases: extools.test.ExTestCase

Verify extools.view.ExView raises on non-zero returns.

generate_raise_tests()[source]

Generate mocked raise tests for all wrapped methods.

Dynamically create a test for each method in extools.view.ExView.WRAP. This should be run during the .setup_class() hook so that the tests are defined before .run() is called.

setup_class()[source]

Dynamically generate the tests for wrapped methods.

class extools.view.tests.extest_exview.ExViewInternalsTestCase(log_level=15)[source]

Bases: extools.test.ExTestCase

Verify extools.view.ExView internals are working.

setup()[source]

Clear the class internals before each test.

test_compose_optfield_view_detection()[source]

Verify that optfield views are detected and helpers added.

test_composed_view_list()[source]

Verify that the list of composed views is determined correctly.

test_detail_view_detection()[source]

Verify that detail views are detected and helpers added.

test_detail_view_wrapper()[source]

Verify that the detail view wrappers work as expected.

test_field_names()[source]

Verify that the list of fiel names is determined correctly.

test_index_detection()[source]

Verify indexes are identified through introspection on init.

test_intial_optfield_view_detection()[source]

Verify that optfield views are detected and helpers added.

test_optfield_view_wrapper()[source]

Verify that the optfield view wrappers work as expected.

test_view_cache()[source]

Verify that the view cache is populated correctly.

class extools.view.tests.extest_exview.ExViewProxyMethodsTestCase(log_level=15)[source]

Bases: extools.test.ExTestCase

Verify extools.view.ExView proxy methods are working.

setup()[source]

Clear the class internals before each test.

test_all()[source]

Verify that all yields all records in a view.

test_create()[source]

Verify that where yields all matching in a view.

test_where()[source]

Verify that where yields all matching in a view.

class extools.view.tests.extest_exview.ExViewViewCacheTestCase(log_level=15)[source]

Bases: extools.test.ExTestCase

Verify extools.view.ExView view cache is working.

setup()[source]

Clear the class internals before each test.

test__view_cache()[source]

Verify that _view_cache returns the cache namespace.

test_cached_view()[source]

Verify that cached_view returns views in the cache namespace.

test_cached_view_create()[source]

Verify that cached_view returns view in the cache namespace.

test_remove_cached_view()[source]

Verify that remove_cached_view removes from the cache namespace.

extools.view.tests.extest_exview.main(*args, **kwargs)[source]

This main hook is picked up by ExTestRunner for automatic execution.