Implement F631 (AssertTuple) (#99)

This commit is contained in:
Harutaka Kawamura 2022-09-04 21:39:49 +09:00 committed by GitHub
parent e2f46537fd
commit 312bfd8d2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 61 additions and 0 deletions

View file

@ -191,6 +191,37 @@ mod tests {
Ok(())
}
#[test]
fn f631() -> Result<()> {
let actual = check_path(
Path::new("./resources/test/fixtures/F631.py"),
&settings::Settings {
line_length: 88,
exclude: vec![],
select: BTreeSet::from([CheckCode::F631]),
},
&cache::Mode::None,
)?;
let expected = vec![
Message {
kind: CheckKind::AssertTuple,
location: Location::new(1, 1),
filename: "./resources/test/fixtures/F631.py".to_string(),
},
Message {
kind: CheckKind::AssertTuple,
location: Location::new(2, 1),
filename: "./resources/test/fixtures/F631.py".to_string(),
},
];
assert_eq!(actual.len(), expected.len());
for i in 0..actual.len() {
assert_eq!(actual[i], expected[i]);
}
Ok(())
}
#[test]
fn f634() -> Result<()> {
let actual = check_path(