Refactor(Project): Change Project Structure
This commit is contained in:
+23
-11
@@ -4,21 +4,33 @@ mod connectivity;
|
||||
mod hotspot;
|
||||
mod platforms;
|
||||
|
||||
pub use connectivity::{Config, *};
|
||||
pub use hotspot::*;
|
||||
pub mod prelude {
|
||||
pub use connectivity::*;
|
||||
pub use hotspot::*;
|
||||
}
|
||||
|
||||
pub use platforms::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use super::prelude::*;
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn connect_to_wifi_failed() {
|
||||
// let config = Some(Config {
|
||||
// interface: Some("wlo1"),
|
||||
// });
|
||||
#[test]
|
||||
fn connect_to_wifi_failed() {
|
||||
let config = Some(Config {
|
||||
interface: Some("wlo1"),
|
||||
});
|
||||
|
||||
// let wifi = WiFi::new("hello", config).unwrap();
|
||||
let mut wifi = WiFi::new(config);
|
||||
|
||||
// assert_eq!(wifi.connect("password").unwrap(), false);
|
||||
}
|
||||
assert_eq!(wifi.connect("ssid", "password").unwrap(), false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn create_hotspot() {
|
||||
let hotspot_created = WiFi::create_hotspot("hello", "hi").unwrap();
|
||||
|
||||
assert_eq!(hotspot_created, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user