def test_agent_type(self): agent = factories.AgentFactory() tree = presentation.objectToAgentXML(agent) agent_xml = etree_to_objectify(tree) element = agent_xml.agentType assert element == agent.agent_type assert has_premis_namespace(element)
def test_agent_identifier_type(self): agent = factories.AgentFactory() tree = presentation.objectToAgentXML(agent) agent_xml = etree_to_objectify(tree) element = agent_xml.agentIdentifier.agentIdentifierType assert element == presentation.PES_AGENT_ID_TYPE assert has_premis_namespace(element)
def test_validate_agentxml(self, premis_schema): agent = factories.AgentFactory() agent_xml = presentation.objectToAgentXML(agent) premis_schema.assert_(agent_xml)
def test_root_namespace(self): agent = factories.AgentFactory() agent_xml = presentation.objectToAgentXML(agent) assert has_premis_namespace(agent_xml)
def test_returns_Element(self): agent = factories.AgentFactory() agent_xml = presentation.objectToAgentXML(agent) assert isinstance(agent_xml, etree._Element)