Revision 2c0be3d0 test/docs_unittest.py

b/test/docs_unittest.py
92 92

  
93 93
      prevline = line
94 94

  
95
    prefix_exception = frozenset(["/", "/version", "/2"])
96

  
95 97
    undocumented = []
96 98

  
97 99
    for key, handler in resources.iteritems():
98 100
      # Regex objects
99 101
      if hasattr(key, "match"):
102
        self.assert_(key.pattern.startswith("^/2/"),
103
                     msg="Pattern %r does not start with '^/2/'" % key.pattern)
104

  
100 105
        found = False
101 106
        for title in titles:
102 107
          if (title.startswith("``") and
......
107 112

  
108 113
        if not found:
109 114
          # TODO: Find better way of identifying resource
110
          undocumented.append(str(handler))
115
          undocumented.append(key.pattern)
116

  
117
      else:
118
        self.assert_(key.startswith("/2/") or key in prefix_exception,
119
                     msg="Path %r does not start with '/2/'" % key)
111 120

  
112
      elif ("``%s``" % key) not in titles:
113
        undocumented.append(key)
121
        if ("``%s``" % key) not in titles:
122
          undocumented.append(key)
114 123

  
115 124
    self.failIf(undocumented,
116 125
                msg=("Missing RAPI resource documentation for %s" %

Also available in: Unified diff