6.2.1.1. server.tests package

6.2.1.1.1. Submodules

6.2.1.1.2. server.tests.test_camera module

class server.tests.test_camera.AbstractCameraContract[source]

Bases: object

Tests a Camera object against the defined Camera contract, essentially proving that it is compatible with all servers that use this defined contract. It uses a PyTest fixture which you must override to use.

Example:
class MyCamera(AbstractCamera):
def init():

self._camera = MagicalCamera()

def still():

return self._camera.capture()

...

class TestMyCamera(AbstractCameraContract):

@pytest.fixture(scope=”module”) def camera(self):

return MyCamera()

camera()[source]
test_low_res_still(camera)[source]
test_resolutions(camera)[source]
test_still(camera)[source]

6.2.1.1.3. server.tests.test_dummy_camera module

class server.tests.test_dummy_camera.TestDummyCamera[source]

Bases: server.tests.test_camera.AbstractCameraContract

camera()[source]
class server.tests.test_dummy_camera.TestDummyCameraOverThrift[source]

Bases: server.tests.test_camera_over_thrift.AbstractCameraOverThrift

local_camera()[source]

6.2.1.1.4. server.tests.test_iptools module

class server.tests.test_iptools.TestIPTools[source]

Bases: object

Unit tests for IPTools module, mainly checking that it extracts the correct IPs from the netifaces package and that they are correctly formatted.

test_current_ip(monkeypatch)[source]
test_current_ip_for_multiple(monkeypatch)[source]
test_current_ips_without_gateway(monkeypatch)[source]
test_gateway_ip(monkeypatch)[source]
test_get_first_digits_from()[source]
test_get_subnet_from()[source]
test_no_best_candidate_ip_no_gateway(monkeypatch)[source]
test_no_best_candidate_no_gateway(monkeypatch)[source]
test_no_gateway_ip(monkeypatch)[source]

6.2.1.1.5. server.tests.test_server module

class server.tests.test_server.MetaCameraServerContract[source]

Bases: object

server()[source]
test_capturing_to_jpgs(server)[source]
test_capturing_to_pngs(server)[source]
test_enumerate_methods(server)[source]
test_identify(server)[source]
test_image_unavailable(server)[source]
test_ping(server)[source]
test_stream_url(server)[source]

6.2.1.1.6. server.tests.test_server_over_thrift module

class server.tests.test_server_over_thrift.MetaCameraServerOverThrift[source]

Bases: server.tests.test_server.MetaCameraServerContract

local_server()[source]
port()[source]
run_server(local_server, port)[source]
server(run_server, port)[source]

6.2.1.1.7. server.tests.test_stream module

server.tests.test_stream.test_jpeg_generator(tmpdir)[source]
server.tests.test_stream.test_newest_file_in_folder_generator(tmpdir)[source]
server.tests.test_stream.test_response(tmpdir)[source]

6.2.1.1.8. Module contents