Beispiel #1
0
 def test_token_failure(self, dep: DEP, expected_status: int,
                        expected_text: str):
     try:
         dep.fetch_token()
     except DEPServiceError as e:
         assert e.response.status_code == expected_status
         assert e.text == expected_text
 def test_fetch_devices(self, dep_live: DEP):
     dep_live.fetch_token()
     devices = dep_live.fetch_devices()
     assert 'cursor' in devices
     assert 'devices' in devices
     assert 'fetched_until' in devices
     assert 'more_to_follow' in devices
    def test_account(self, dep_live: DEP):
        dep_live.fetch_token()
        account = dep_live.account()
        assert account is not None
        assert 'server_name' in account
        assert 'server_uuid' in account
        assert 'facilitator_id' in account
        assert 'admin_id' in account
        assert 'org_name' in account
        assert 'org_email' in account
        assert 'org_phone' in account
        assert 'org_address' in account

        # X-Server-Protocol 3
        assert 'org_id' in account
        assert 'org_id_hash' in account
        assert 'org_type' in account
        assert 'org_version' in account
 def test_get_profile(self, dep_live: DEP, live_dep_profile: str):
     dep_live.fetch_token()
     profiles = dep_live.profile(live_dep_profile)
     print(profiles)
 def test_device_details(self, dep_live: DEP, live_device: str):
     dep_live.fetch_token()
     device_details = dep_live.device_detail(live_device)
     print(device_details)
Beispiel #6
0
 def test_account(self, dep: DEP):
     dep.fetch_token()
     account = dep.account()
     assert account is not None
Beispiel #7
0
 def test_fetch_cursor(self, dep: DEP):
     dep.fetch_token()
     for page in dep.devices():
         print(len(page))
         for d in page:
             print(d)
Beispiel #8
0
 def test_fetch_devices(self, dep: DEP):
     dep.fetch_token()
     devices = dep.fetch_devices()
     assert len(devices) == 500