Green Button Tests Package

Submodules

XML Importer Tests

class seed.green_button.tests.test_xml_importer.GreenButtonXMLImportTests(methodName=’runTest’)

Bases: django.test.testcases.TestCase

Tests of various ways of authenticating to the API.

Uses the get_building endpoint in all cases.

assert_models_created()

Tests that appropriate models for the sample xml file have been created.

setUp()
tearDown()
test_create_models()

Test of xml_importer.create_models.

test_import_xml()

Test of xml_importer.import_xml.

class seed.green_button.tests.test_xml_importer.GreenButtonXMLParsingTests(methodName=’runTest’)

Bases: django.test.testcases.TestCase

Tests helper functions for pulling green button building data out of xml snippets.

assert_fn_mapping(fn, mapping)

Takes a function fn and a mapping from input values to expected output values. Asserts that fn returns the expected output for each of the input values.

setUp()
tearDown()
test_as_collection()

Test of xml_importer.as_collection.

test_building_data()

Test of xml_importer.building_data.

test_energy_type()

Test of xml_importer.energy_type.

test_energy_units()

Test of function that converts a green button ‘uom’ (unit of measurement?) integer to one of seed.models.ENERGY_UNITS.

test_interval_block_data()

Test of xml_importer.interval_block_data.

test_interval_data()

Test of xml_importer.interval_data.

test_meter_data()

Test of xml_importer.meter_data.

Module contents