1
/*
2
Copyright (C) 2022 Kunal Mehta <legoktm@debian.org>
3

            
4
This program is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8

            
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
GNU General Public License for more details.
13

            
14
You should have received a copy of the GNU General Public License
15
along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
use crate::prelude::*;
18

            
19
96
pub fn client(url: &str) -> ParsoidClient {
20
96
    ParsoidClient::new(url, "parsoid-rs testing").unwrap()
21
96
}
22

            
23
const TEST_ENDPOINT: &str = "https://{}/w/rest.php";
24
// const TEST_ENDPOINT: &str = "https://{}/api/rest_v1";
25
// const TEST_ENDPOINT: &str = "https://{}/w/rest.php/{}/v3";
26

            
27
70
pub fn mw_client() -> ParsoidClient {
28
70
    client(&TEST_ENDPOINT.replace("{}", "www.mediawiki.org"))
29
70
}
30

            
31
8
pub fn enwp_client() -> ParsoidClient {
32
8
    client(&TEST_ENDPOINT.replace("{}", "en.wikipedia.org"))
33
8
}
34

            
35
18
pub fn testwp_client() -> ParsoidClient {
36
18
    client(&TEST_ENDPOINT.replace("{}", "test.wikipedia.org"))
37
18
}