Skip to content

Commit 99a477b

Browse files
committed
[IMP] Tests for OLS01008
1 parent f64076e commit 99a477b

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
def a():
2+
pass
3+
4+
a()
5+
a(d=5) # OLS01008
6+
a(a=3) # OLS01008
7+
8+
def b(x, y, *, z):
9+
pass
10+
11+
b(1, 2, z=3)
12+
b(1, 2, z=3, z2=5) # OLS01008
13+
b(1, 2, z2=5, z=3) # OLS01008
14+
b(1, 2, z2=3) # OLS01008, OLS01010
15+
16+
def c(*, x):
17+
pass
18+
19+
c(x=10)
20+
c(y=5, x=10) # OLS01008
21+
c(x=10, y=5) # OLS01008
22+
23+
def d(a, *args):
24+
pass
25+
26+
d(5)
27+
d(5, d=3) # OLS01008
28+
29+
def e(a, **kwargs):
30+
pass
31+
32+
e(5)
33+
e(5, d=3)
34+
e(6, d=5, e=6, f=7)
35+
36+
def e(a, *args, **kwargs):
37+
pass
38+
39+
e(5)
40+
e(5, 6, 7, d=3)
41+
e(6, 6, 7, d=5, e=6, f=7)

server/tests/diagnostics/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ pub mod ols01004;
77
pub mod ols01005;
88
pub mod ols01006;
99
pub mod ols01007;
10-
pub mod ols0500_00_12;
10+
pub mod ols01008;
11+
pub mod ols0500_00_12;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use std::env;
2+
3+
use odoo_ls_server::utils::PathSanitizer;
4+
5+
use crate::{setup::setup::*, test_utils::{verify_diagnostics_against_doc}};
6+
7+
#[test]
8+
fn test_ols01008() {
9+
let mut odoo = setup_server(false);
10+
let path = env::current_dir().unwrap().join("tests/data/python/diagnostics/ols01008.py").sanitize();
11+
let mut session = prepare_custom_entry_point(&mut odoo, &path);
12+
let diagnostics = get_diagnostics_for_path(&mut session, &path);
13+
let doc_diags = get_diagnostics_test_comments(&mut session, &path);
14+
verify_diagnostics_against_doc(diagnostics, doc_diags);
15+
}

0 commit comments

Comments
 (0)