{"action":"created","comment":{"url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/comments/47701787","id":47701787,"diff_hunk":"@@ -32,22 +36,59 @@ def testDCJSON(self):\n                             % (key, UNTL_DICT))\n \n     def testDCtoRDF(self):\n-        '''test dublin core to RDF function'''\n+        \"\"\"Test Dublin Core to RDF function.\"\"\"\n         rdf = dcdict2rdfpy(UNTL_DICT)\n         self.assertEqual(type(rdf), ConjunctiveGraph)\n \n     def testDCText(self):\n-        '''test that we can generate a dc text'''\n+        \"\"\"Test that we can generate a dc text.\"\"\"\n         dctext = generate_dc_txt(UNTL_DICT)\n         self.assertEqual(type(dctext), str)\n \n-    def testDCxml(self):\n-        '''render valid dublin core xml test'''\n-        dxml = generate_dc_xml(UNTL_DICT)\n-        self.assertEqual(dxml.strip(), DUBLIN_CORE_XML.strip())\n+    def testDCXMLRootElement(self):\n+        \"\"\"Check the Dublin Core for expected attrib and nsmap on root.\"\"\"\n+        generated_dxml = generate_dc_xml(UNTL_DICT)\n+\n+        # Verify root element has expected attribs, nsmap, and tag.\n+        generated_dxml_root = objectify.fromstring(generated_dxml)\n+\n+        schema_location = ('http://www.openarchives.org/OAI/2.0/oai_dc/ '\n+                           'http://www.openarchives.org/OAI/2.0/oai_dc.xsd')\n+        expected_tag = '{http://www.openarchives.org/OAI/2.0/oai_dc/}dc'\n+\n+        self.assertTrue(schema_location in generated_dxml_root.attrib.values())\n+        self.assertEqual(generated_dxml_root.nsmap, DC_NAMESPACES)\n+        self.assertEqual(generated_dxml_root.tag, expected_tag)\n+\n+    def testDCXMLNonRootElements(self):\n+        \"\"\"Test for expected Dublin Core elements.\"\"\"\n+        generated_dxml = generate_dc_xml(UNTL_DICT)\n+\n+        generated_dxml_root = objectify.fromstring(generated_dxml)\n+        constant_dxml_root = objectify.fromstring(DUBLIN_CORE_XML)\n+        results = []\n+        # Check if each of the root's children from the generated XML\n+        # has a match in the string constant's XML.\n+        for child in generated_dxml_root.iterchildren():\n+            # For each child, get all of the children with the same tag\n+            # from the XML being compared.\n+            same_tag_list = constant_dxml_root.findall(child.tag)\n+            element_found = False\n+            child_children = len(child.getchildren())\n+            # Check if any of the possible elements are a match.\n+            for current in same_tag_list:\n+                if (current.text == child.text and\n+                        current.tail == child.tail and\n+                        current.attrib == child.attrib and\n+                        len(current.getchildren()) == child_children):\n+                    element_found = True\n+                    break\n+            results.append(element_found)","path":"tests/dublincore.py","position":90,"original_position":90,"commit_id":"77d7fc1c0be6f2ebd180086d4b019ec7dc36cb2f","original_commit_id":"77d7fc1c0be6f2ebd180086d4b019ec7dc36cb2f","user":{"login":"damonkelley","id":4121849,"avatar_url":"https://avatars.githubusercontent.com/u/4121849?v=3","gravatar_id":"","url":"https://api.github.com/users/damonkelley","html_url":"https://github.com/damonkelley","followers_url":"https://api.github.com/users/damonkelley/followers","following_url":"https://api.github.com/users/damonkelley/following{/other_user}","gists_url":"https://api.github.com/users/damonkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/damonkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damonkelley/subscriptions","organizations_url":"https://api.github.com/users/damonkelley/orgs","repos_url":"https://api.github.com/users/damonkelley/repos","events_url":"https://api.github.com/users/damonkelley/events{/privacy}","received_events_url":"https://api.github.com/users/damonkelley/received_events","type":"User","site_admin":false},"body":"ah, that makes sense\r\n","created_at":"2015-12-15T21:32:42Z","updated_at":"2015-12-15T21:32:42Z","html_url":"https://github.com/unt-libraries/pyuntl/pull/7#discussion_r47701787","pull_request_url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/comments/47701787"},"html":{"href":"https://github.com/unt-libraries/pyuntl/pull/7#discussion_r47701787"},"pull_request":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7","id":53758032,"html_url":"https://github.com/unt-libraries/pyuntl/pull/7","diff_url":"https://github.com/unt-libraries/pyuntl/pull/7.diff","patch_url":"https://github.com/unt-libraries/pyuntl/pull/7.patch","issue_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues/7","number":7,"state":"open","locked":false,"title":"Fixes failing tests in record.py and dublincore.py","user":{"login":"ldko","id":6740390,"avatar_url":"https://avatars.githubusercontent.com/u/6740390?v=3","gravatar_id":"","url":"https://api.github.com/users/ldko","html_url":"https://github.com/ldko","followers_url":"https://api.github.com/users/ldko/followers","following_url":"https://api.github.com/users/ldko/following{/other_user}","gists_url":"https://api.github.com/users/ldko/gists{/gist_id}","starred_url":"https://api.github.com/users/ldko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldko/subscriptions","organizations_url":"https://api.github.com/users/ldko/orgs","repos_url":"https://api.github.com/users/ldko/repos","events_url":"https://api.github.com/users/ldko/events{/privacy}","received_events_url":"https://api.github.com/users/ldko/received_events","type":"User","site_admin":false},"body":"Fixes failing tests in record.py and dublincore.py related to expectation that XML element attributes and children will be in consistent order. Includes some pep8 clean up in dublincore.py. Further pep8 cleanup for pyuntl should be in different PR. Will fix #2.","created_at":"2015-12-15T20:32:16Z","updated_at":"2015-12-15T21:32:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ff9de000603eac735a7b5598ccda981759c0302","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7/commits","review_comments_url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7/comments","review_comment_url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues/7/comments","statuses_url":"https://api.github.com/repos/unt-libraries/pyuntl/statuses/77d7fc1c0be6f2ebd180086d4b019ec7dc36cb2f","head":{"label":"unt-libraries:fix-failing-tests","ref":"fix-failing-tests","sha":"77d7fc1c0be6f2ebd180086d4b019ec7dc36cb2f","user":{"login":"unt-libraries","id":6526233,"avatar_url":"https://avatars.githubusercontent.com/u/6526233?v=3","gravatar_id":"","url":"https://api.github.com/users/unt-libraries","html_url":"https://github.com/unt-libraries","followers_url":"https://api.github.com/users/unt-libraries/followers","following_url":"https://api.github.com/users/unt-libraries/following{/other_user}","gists_url":"https://api.github.com/users/unt-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/unt-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unt-libraries/subscriptions","organizations_url":"https://api.github.com/users/unt-libraries/orgs","repos_url":"https://api.github.com/users/unt-libraries/repos","events_url":"https://api.github.com/users/unt-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/unt-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":40995675,"name":"pyuntl","full_name":"unt-libraries/pyuntl","owner":{"login":"unt-libraries","id":6526233,"avatar_url":"https://avatars.githubusercontent.com/u/6526233?v=3","gravatar_id":"","url":"https://api.github.com/users/unt-libraries","html_url":"https://github.com/unt-libraries","followers_url":"https://api.github.com/users/unt-libraries/followers","following_url":"https://api.github.com/users/unt-libraries/following{/other_user}","gists_url":"https://api.github.com/users/unt-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/unt-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unt-libraries/subscriptions","organizations_url":"https://api.github.com/users/unt-libraries/orgs","repos_url":"https://api.github.com/users/unt-libraries/repos","events_url":"https://api.github.com/users/unt-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/unt-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unt-libraries/pyuntl","description":"Python package for reading and writing UNTL metadata records.","fork":false,"url":"https://api.github.com/repos/unt-libraries/pyuntl","forks_url":"https://api.github.com/repos/unt-libraries/pyuntl/forks","keys_url":"https://api.github.com/repos/unt-libraries/pyuntl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unt-libraries/pyuntl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unt-libraries/pyuntl/teams","hooks_url":"https://api.github.com/repos/unt-libraries/pyuntl/hooks","issue_events_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues/events{/number}","events_url":"https://api.github.com/repos/unt-libraries/pyuntl/events","assignees_url":"https://api.github.com/repos/unt-libraries/pyuntl/assignees{/user}","branches_url":"https://api.github.com/repos/unt-libraries/pyuntl/branches{/branch}","tags_url":"https://api.github.com/repos/unt-libraries/pyuntl/tags","blobs_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/refs{/sha}","trees_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unt-libraries/pyuntl/statuses/{sha}","languages_url":"https://api.github.com/repos/unt-libraries/pyuntl/languages","stargazers_url":"https://api.github.com/repos/unt-libraries/pyuntl/stargazers","contributors_url":"https://api.github.com/repos/unt-libraries/pyuntl/contributors","subscribers_url":"https://api.github.com/repos/unt-libraries/pyuntl/subscribers","subscription_url":"https://api.github.com/repos/unt-libraries/pyuntl/subscription","commits_url":"https://api.github.com/repos/unt-libraries/pyuntl/commits{/sha}","git_commits_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/commits{/sha}","comments_url":"https://api.github.com/repos/unt-libraries/pyuntl/comments{/number}","issue_comment_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues/comments{/number}","contents_url":"https://api.github.com/repos/unt-libraries/pyuntl/contents/{+path}","compare_url":"https://api.github.com/repos/unt-libraries/pyuntl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unt-libraries/pyuntl/merges","archive_url":"https://api.github.com/repos/unt-libraries/pyuntl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unt-libraries/pyuntl/downloads","issues_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues{/number}","pulls_url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls{/number}","milestones_url":"https://api.github.com/repos/unt-libraries/pyuntl/milestones{/number}","notifications_url":"https://api.github.com/repos/unt-libraries/pyuntl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unt-libraries/pyuntl/labels{/name}","releases_url":"https://api.github.com/repos/unt-libraries/pyuntl/releases{/id}","created_at":"2015-08-18T20:22:42Z","updated_at":"2015-08-26T16:26:00Z","pushed_at":"2015-12-15T20:32:16Z","git_url":"git://github.com/unt-libraries/pyuntl.git","ssh_url":"git@github.com:unt-libraries/pyuntl.git","clone_url":"https://github.com/unt-libraries/pyuntl.git","svn_url":"https://github.com/unt-libraries/pyuntl","homepage":"","size":70,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"unt-libraries:master","ref":"master","sha":"4aec6b7879c5c8efe5e252e934a58e886083de92","user":{"login":"unt-libraries","id":6526233,"avatar_url":"https://avatars.githubusercontent.com/u/6526233?v=3","gravatar_id":"","url":"https://api.github.com/users/unt-libraries","html_url":"https://github.com/unt-libraries","followers_url":"https://api.github.com/users/unt-libraries/followers","following_url":"https://api.github.com/users/unt-libraries/following{/other_user}","gists_url":"https://api.github.com/users/unt-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/unt-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unt-libraries/subscriptions","organizations_url":"https://api.github.com/users/unt-libraries/orgs","repos_url":"https://api.github.com/users/unt-libraries/repos","events_url":"https://api.github.com/users/unt-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/unt-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":40995675,"name":"pyuntl","full_name":"unt-libraries/pyuntl","owner":{"login":"unt-libraries","id":6526233,"avatar_url":"https://avatars.githubusercontent.com/u/6526233?v=3","gravatar_id":"","url":"https://api.github.com/users/unt-libraries","html_url":"https://github.com/unt-libraries","followers_url":"https://api.github.com/users/unt-libraries/followers","following_url":"https://api.github.com/users/unt-libraries/following{/other_user}","gists_url":"https://api.github.com/users/unt-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/unt-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unt-libraries/subscriptions","organizations_url":"https://api.github.com/users/unt-libraries/orgs","repos_url":"https://api.github.com/users/unt-libraries/repos","events_url":"https://api.github.com/users/unt-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/unt-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unt-libraries/pyuntl","description":"Python package for reading and writing UNTL metadata records.","fork":false,"url":"https://api.github.com/repos/unt-libraries/pyuntl","forks_url":"https://api.github.com/repos/unt-libraries/pyuntl/forks","keys_url":"https://api.github.com/repos/unt-libraries/pyuntl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unt-libraries/pyuntl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unt-libraries/pyuntl/teams","hooks_url":"https://api.github.com/repos/unt-libraries/pyuntl/hooks","issue_events_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues/events{/number}","events_url":"https://api.github.com/repos/unt-libraries/pyuntl/events","assignees_url":"https://api.github.com/repos/unt-libraries/pyuntl/assignees{/user}","branches_url":"https://api.github.com/repos/unt-libraries/pyuntl/branches{/branch}","tags_url":"https://api.github.com/repos/unt-libraries/pyuntl/tags","blobs_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/refs{/sha}","trees_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unt-libraries/pyuntl/statuses/{sha}","languages_url":"https://api.github.com/repos/unt-libraries/pyuntl/languages","stargazers_url":"https://api.github.com/repos/unt-libraries/pyuntl/stargazers","contributors_url":"https://api.github.com/repos/unt-libraries/pyuntl/contributors","subscribers_url":"https://api.github.com/repos/unt-libraries/pyuntl/subscribers","subscription_url":"https://api.github.com/repos/unt-libraries/pyuntl/subscription","commits_url":"https://api.github.com/repos/unt-libraries/pyuntl/commits{/sha}","git_commits_url":"https://api.github.com/repos/unt-libraries/pyuntl/git/commits{/sha}","comments_url":"https://api.github.com/repos/unt-libraries/pyuntl/comments{/number}","issue_comment_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues/comments{/number}","contents_url":"https://api.github.com/repos/unt-libraries/pyuntl/contents/{+path}","compare_url":"https://api.github.com/repos/unt-libraries/pyuntl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unt-libraries/pyuntl/merges","archive_url":"https://api.github.com/repos/unt-libraries/pyuntl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unt-libraries/pyuntl/downloads","issues_url":"https://api.github.com/repos/unt-libraries/pyuntl/issues{/number}","pulls_url":"https://api.github.com/repos/unt-libraries/pyuntl/pulls{/number}","milestones_url":"https://api.github.com/repos/unt-libraries/pyuntl/milestones{/number}","notifications_url":"https://api.github.com/repos/unt-libraries/pyuntl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unt-libraries/pyuntl/labels{/name}","releases_url":"https://api.github.com/repos/unt-libraries/pyuntl/releases{/id}","created_at":"2015-08-18T20:22:42Z","updated_at":"2015-08-26T16:26:00Z","pushed_at":"2015-12-15T20:32:16Z","git_url":"git://github.com/unt-libraries/pyuntl.git","ssh_url":"git@github.com:unt-libraries/pyuntl.git","clone_url":"https://github.com/unt-libraries/pyuntl.git","svn_url":"https://github.com/unt-libraries/pyuntl","homepage":"","size":70,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7"},"html":{"href":"https://github.com/unt-libraries/pyuntl/pull/7"},"issue":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/issues/7"},"comments":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/unt-libraries/pyuntl/statuses/77d7fc1c0be6f2ebd180086d4b019ec7dc36cb2f"}}}}