File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ class Cl ():
3+
4+ def func (self ):
5+ pass
6+
7+ class SubCl (Cl ):
8+ pass
9+
10+ cl = Cl ()
11+ subcl = SubCl ()
12+
13+ super (SubCl , subcl ).func () #working
14+
15+ super ().func () #OLS01006
Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ pub mod ols01002;
55pub mod ols01003;
66pub mod ols01004;
77pub mod ols01005;
8+ pub mod ols01006;
Original file line number Diff line number Diff line change 1+ use std:: env;
2+
3+ use lsp_types:: { DiagnosticSeverity , NumberOrString } ;
4+ use odoo_ls_server:: { S , utils:: PathSanitizer } ;
5+
6+ use crate :: { setup:: setup:: * , test_utils:: diag_on_line} ;
7+
8+ #[ test]
9+ fn test_ols01006 ( ) {
10+ let mut odoo = setup_server ( false ) ;
11+ let path = env:: current_dir ( ) . unwrap ( ) . join ( "tests/data/python/diagnostics/ols01006.py" ) . sanitize ( ) ;
12+ let mut session = prepare_custom_entry_point ( & mut odoo, & path) ;
13+ let diagnostics = get_diagnostics_for_path ( & mut session, & path) ;
14+ assert_eq ! ( diagnostics. len( ) , 1 ) ;
15+ let diagnostics = diag_on_line ( & diagnostics, 14 ) ;
16+ assert_eq ! ( diagnostics. len( ) , 1 ) ;
17+ let diag = & diagnostics[ 0 ] ;
18+ assert ! ( diag. code. is_some( ) ) ;
19+ let code = match & diag. code {
20+ Some ( NumberOrString :: String ( code) ) => code,
21+ Some ( NumberOrString :: Number ( num) ) => panic ! ( "Unexpected numeric code: {}" , num) ,
22+ None => panic ! ( "Diagnostic code is None" ) ,
23+ } ;
24+ assert ! ( code == & S !( "OLS01006" ) ) ;
25+ assert ! ( diag. severity. is_some_and( |s| s == DiagnosticSeverity :: ERROR ) ) ;
26+ }
You can’t perform that action at this time.
0 commit comments