Implement E713 and E714 (#111)

This commit is contained in:
Charlie Marsh 2022-09-06 10:23:20 -04:00 committed by GitHub
parent e306fe0765
commit 27025055ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 120 additions and 2 deletions

View file

@ -209,6 +209,54 @@ mod tests {
Ok(())
}
#[test]
fn e713() -> Result<()> {
let actual = check_path(
Path::new("./resources/test/fixtures/E713.py"),
&settings::Settings {
line_length: 88,
exclude: vec![],
select: BTreeSet::from([CheckCode::E713]),
},
&autofix::Mode::Generate,
)?;
let expected = vec![Check {
kind: CheckKind::NotInTest,
location: Location::new(2, 12),
fix: None,
}];
assert_eq!(actual.len(), expected.len());
for i in 0..actual.len() {
assert_eq!(actual[i], expected[i]);
}
Ok(())
}
#[test]
fn e714() -> Result<()> {
let actual = check_path(
Path::new("./resources/test/fixtures/E714.py"),
&settings::Settings {
line_length: 88,
exclude: vec![],
select: BTreeSet::from([CheckCode::E714]),
},
&autofix::Mode::Generate,
)?;
let expected = vec![Check {
kind: CheckKind::NotIsTest,
location: Location::new(1, 13),
fix: None,
}];
assert_eq!(actual.len(), expected.len());
for i in 0..actual.len() {
assert_eq!(actual[i], expected[i]);
}
Ok(())
}
#[test]
fn e731() -> Result<()> {
let actual = check_path(