Skip to content

Commit 971a474

Browse files
committed
Add test case and permit RSS usage of atom:links
git-svn-id: http://feedvalidator.googlecode.com/svn/trunk@433 34a10a33-d82d-0410-ba40-81c901463ecc
1 parent 16c295f commit 971a474

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/feedvalidator/link.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def validate(self):
4040
self.value = self.type = self.attrs.getValue((None, "type"))
4141
if not mime_re.match(self.type):
4242
self.log(InvalidMIMEType({"parent":self.parent.name, "element":self.name, "attr":"type", "value":self.type}))
43-
elif self.rel == "self" and self.type != "application/atom+xml":
43+
elif self.rel == "self" and self.type not in ["application/atom+xml", "application/rss+xml", "application/rdf+xml"]:
4444
self.log(SelfNotAtom({"parent":self.parent.name, "element":self.name, "attr":"type", "value":self.type}))
4545
else:
4646
self.log(ValidMIMEAttribute({"parent":self.parent.name, "element":self.name, "attr":"type", "value":self.type}))
@@ -82,6 +82,9 @@ def characters(self, text):
8282

8383
__history__ = """
8484
$Log$
85+
Revision 1.25 2006/01/30 19:16:36 rubys
86+
Add test case and permit RSS usage of atom:links
87+
8588
Revision 1.24 2006/01/30 15:38:59 rubys
8689
Check for "self" values referencing non-Atom representations
8790
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Id: $Id$
4+
Author: Sam Ruby <[email protected]>
5+
Version: $Revision$
6+
Date: $Date$
7+
License: Python
8+
-->
9+
10+
<!--
11+
Description: Self-rel referencing a non-Atom representation
12+
Expect: SelfNotAtom
13+
-->
14+
15+
<feed xmlns="http://www.w3.org/2005/Atom">
16+
17+
<title>Example Feed</title>
18+
<link href="http://example.org/"/>
19+
<updated>2003-12-13T18:30:02Z</updated>
20+
<author>
21+
<name>John Doe</name>
22+
</author>
23+
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
24+
25+
<entry>
26+
<title>Atom-Powered Robots Run Amok</title>
27+
<link rel="self" type="text/html" href="http://example.org/2003/12/13/atom03"/>
28+
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
29+
<updated>2003-12-13T18:30:02Z</updated>
30+
<summary>Some text.</summary>
31+
</entry>
32+
33+
</feed>

0 commit comments

Comments
 (0)