File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 6
6
private_key : "/home/ruscur/.ssh/id_rsa" ,
7
7
),
8
8
patchwork : (
9
- url : "https//patchwork.ozlabs.org"
9
+ url : "https: //patchwork.ozlabs.org"
10
10
//username: "ruscur",
11
11
//token: "bigchungus42069",
12
12
)
Original file line number Diff line number Diff line change 1
1
//
2
2
// snowpatch - continuous integration for patch-based workflows
3
3
//
4
- // Copyright (C) 2016 IBM Corporation
4
+ // Copyright (C) 2021 IBM Corporation
5
5
// Authors:
6
6
// Russell Currey <[email protected] >
7
7
// Andrew Donnellan <[email protected] >
@@ -81,3 +81,32 @@ pub fn parse_config(filename: &str) -> Result<Config> {
81
81
82
82
Ok ( config)
83
83
}
84
+
85
+ #[ cfg( test) ]
86
+ mod tests {
87
+ use super :: * ;
88
+
89
+ #[ test]
90
+ fn validate_good_config ( ) {
91
+ let good_config: Config = Config {
92
+ name : "linuxppc-dev" . to_owned ( ) ,
93
+ git : Git {
94
+ user : "git" . to_owned ( ) ,
95
+ public_key : "/home/ruscur/.ssh/id_rsa.pub" . to_owned ( ) ,
96
+ private_key : "/home/ruscur/.ssh/id_rsa" . to_owned ( ) ,
97
+ } ,
98
+ patchwork : Patchwork {
99
+ url : "https://patchwork.ozlabs.org" . to_owned ( ) ,
100
+ port : None ,
101
+ token : None ,
102
+ } ,
103
+ } ;
104
+
105
+ assert ! ( validate_config( & good_config) . is_ok( ) ) ;
106
+ }
107
+
108
+ #[ test]
109
+ fn parse_good_config ( ) {
110
+ assert ! ( parse_config( "examples/tests/valid.ron" ) . is_ok( ) ) ;
111
+ }
112
+ }
You can’t perform that action at this time.
0 commit comments