def test_machine_keys(): schema = ResourceSchema().machine_schema assert 'hostname' in schema assert 'owner' in schema assert 'state' in schema assert 'job_id' in schema assert 'tags' in schema
def test_domains(): schema = ResourceSchema() domain_check(schema.machines, "machine") domain_check(schema.private_addresses, "private-address") domain_check(schema.public_addresses, "public-address")
def test_address_unique(): schema = ResourceSchema().address_schema assert schema['address']['unique']
def test_address_required(): schema = ResourceSchema().address_schema assert schema['address']['required']
def test_address_keys(): schema = ResourceSchema().address_schema assert 'address' in schema assert 'owner' in schema
def test_machine_states(): schema = ResourceSchema().machine_schema assert schema["state"]['allowed'] == [ "pxe", "pxe_failed", "idle", "in_use", "needs_repair" ]
def test_machine_unique(): schema = ResourceSchema().machine_schema assert schema['hostname']['unique']
def test_machine_required(): schema = ResourceSchema().machine_schema assert schema['hostname']['required'] assert schema['state']['required']