Skip to content

Commit a521a4c

Browse files
committed
[IMP] tests for OLS01010
1 parent 324e598 commit a521a4c

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def a(*, x):
2+
pass
3+
4+
a() # OLS01010
5+
a(x=5)
6+
a(y=5) # OLS01010, OLS01008
7+
8+
def b(*, x=5):
9+
pass
10+
11+
b()
12+
b(x=6)
13+
b(y=7) # OLS01008
14+
15+
def c(*, x, y, z):
16+
pass
17+
18+
c(z=5) # OLS01010
19+
c(x=5, y=6, z=7)
20+
c(x=5, y=6, z=7, w=8) # OLS01008
21+
c(z=5, y=5, x=5)
22+
c(y=5, z=5) # OLS01010
23+
c(x=5, z=5) # OLS01010
24+
c(x=5, y=5) # OLS01010

server/tests/diagnostics/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ pub mod ols01006;
99
pub mod ols01007;
1010
pub mod ols01008;
1111
pub mod ols01009;
12+
pub mod ols01010;
1213
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_ols01010() {
9+
let mut odoo = setup_server(false);
10+
let path = env::current_dir().unwrap().join("tests/data/python/diagnostics/ols01010.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)