Skip to content

Commit

Permalink
Merge #248
Browse files Browse the repository at this point in the history
248: Fix running tests inside user units r=jmesmon a=mtorromeo

The assertion in `test_get_unit` failed on the assumption that there could only be either a system unit or a user unit, while having both is possible.

For example, in my system every desktop application gets its own user unit (e.g. `app-org.kde.konsole-<SOMEID>.scope`) and this is in turn part of the system unit which owns the user session (e.g. `[email protected]`).

I'm assuming that every user unit will be part of such a `[email protected]` and so I changed the assertion to only verify that condition.

Co-authored-by: Massimiliano Torromeo <[email protected]>
  • Loading branch information
bors[bot] and mtorromeo authored Jan 17, 2022
2 parents 536092f + 322ef4b commit f1fe7fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ fn test_get_unit() {
assert!(uu.is_err());
assert!(su.is_err());
}
// This is either running in a system or in a user unit
// User units run under a system unit (E.g. user@1000.service)
true => {
assert_eq!(uu.is_err(), su.is_ok());
assert!(su.is_ok());
}
};
}
Expand Down

0 comments on commit f1fe7fc

Please sign in to comment.