Refactor(Project): Change Project Structure

This commit is contained in:
Tochukwu Nkemdilim
2018-07-19 16:14:34 +01:00
parent e8b83bf245
commit 65c641670d
17 changed files with 268 additions and 250 deletions
+23 -11
View File
@@ -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);
}
}