Implement D205, D209, and D210 (#398)

This commit is contained in:
Charlie Marsh 2022-10-10 16:49:51 -04:00 committed by GitHub
parent b8dce8922d
commit 4e9fb9907a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 889 additions and 106 deletions

View file

@ -981,7 +981,7 @@ mod tests {
#[test]
fn d200() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/D200.py"),
Path::new("./resources/test/fixtures/D.py"),
&settings::Settings::for_rule(CheckCode::D200),
&fixer::Mode::Generate,
)?;
@ -990,10 +990,46 @@ mod tests {
Ok(())
}
#[test]
fn d205() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/D.py"),
&settings::Settings::for_rule(CheckCode::D205),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d209() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/D.py"),
&settings::Settings::for_rule(CheckCode::D209),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d210() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/D.py"),
&settings::Settings::for_rule(CheckCode::D210),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn d400() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/D400.py"),
Path::new("./resources/test/fixtures/D.py"),
&settings::Settings::for_rule(CheckCode::D400),
&fixer::Mode::Generate,
)?;
@ -1005,7 +1041,7 @@ mod tests {
#[test]
fn d419() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/D419.py"),
Path::new("./resources/test/fixtures/D.py"),
&settings::Settings::for_rule(CheckCode::D419),
&fixer::Mode::Generate,
)?;