mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Improved quickdoc tests.
This commit is contained in:
@@ -1 +1 @@
|
||||
<html><body><code><small>class <a href="psi_element://#class#">A</a>(<a href="psi_element://#parent#object">object</a>)</small><br><br>@<i>property</i><br>def <b>x</b>(self)<br>Inferred return type: int<br>Does things to X</code></body></html>
|
||||
<html><body>property <b><code>x</code></b> of class <a href="psi_element://#class#">A</a>(<a href="psi_element://#parent#object">object</a>)<code><br><br>@<i>property</i><br>def <b>x</b>(self)<br>Inferred return type: int<br>Does things to X</code><small><br><br>Getter of property</small><br></body></html>
|
||||
@@ -1,10 +1 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html><body>property <b><code>x</code></b> of class <a href="psi_element://#class#">A</a>(<a href="psi_element://#parent#object">object</a>)<code><br><br>def <b>__getX</b>(self)<br>Inferred return type: unknown<br>Doc of getter</code><small><br><br>Deleter of property</small><br></body></html>
|
||||
@@ -4,4 +4,5 @@
|
||||
return self.__x
|
||||
x = property(fdel=__getX)
|
||||
|
||||
del A().<the_ref>x
|
||||
a = A()
|
||||
del a.<the_ref>x
|
||||
@@ -1,10 +1 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html><body>property <b><code>x</code></b> of class <a href="psi_element://#class#">A</a>(<a href="psi_element://#parent#object">object</a>)<code><br><br>def <b>__getX</b>(self)<br>Inferred return type: unknown<br>Doc of getter</code><small><br><br>Getter of property</small><br></body></html>
|
||||
@@ -1,10 +1 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<html><body>property <b><code>x</code></b> of class <a href="psi_element://#class#">A</a>(<a href="psi_element://#parent#object">object</a>)<code><br><br>def <b>__getX</b>(self, x)<br>Inferred return type: None<br>Doc of getter</code><small><br><br>Setter of property</small><br></body></html>
|
||||
@@ -46,7 +46,8 @@ public class PyQuickDocTest extends LightMarkedTestCase {
|
||||
private void checkRefDocPair() throws Exception {
|
||||
Map<String, PsiElement> marks = loadTest();
|
||||
assertEquals(2, marks.size());
|
||||
PsiElement doc_elt = marks.get("<the_doc>").getParent(); // ident -> expr
|
||||
final PsiElement original_elt = marks.get("<the_doc>");
|
||||
PsiElement doc_elt = original_elt.getParent(); // ident -> expr
|
||||
assertTrue(doc_elt instanceof PyStringLiteralExpression);
|
||||
String doc_text = ((PyStringLiteralExpression)doc_elt).getStringValue();
|
||||
assertNotNull(doc_text);
|
||||
@@ -55,14 +56,15 @@ public class PyQuickDocTest extends LightMarkedTestCase {
|
||||
final PyDocStringOwner doc_owner = (PyDocStringOwner)((PyReferenceExpression)ref_elt).getReference().resolve();
|
||||
assertEquals(doc_elt, doc_owner.getDocStringExpression());
|
||||
|
||||
checkByHTML(myProvider.generateDoc(doc_owner, null));
|
||||
checkByHTML(myProvider.generateDoc(doc_owner, original_elt));
|
||||
}
|
||||
|
||||
private void checkHTMLOnly() throws Exception {
|
||||
Map<String, PsiElement> marks = loadTest();
|
||||
PsiElement ref_elt = marks.get("<the_ref>").getParent(); // ident -> expr
|
||||
final PsiElement original_elt = marks.get("<the_ref>");
|
||||
PsiElement ref_elt = original_elt.getParent(); // ident -> expr
|
||||
final PyDocStringOwner doc_owner = (PyDocStringOwner)((PyReferenceExpression)ref_elt).getReference().resolve();
|
||||
checkByHTML(myProvider.generateDoc(doc_owner, null));
|
||||
checkByHTML(myProvider.generateDoc(doc_owner, original_elt));
|
||||
}
|
||||
|
||||
public void testDirectFunc() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user